summaryrefslogtreecommitdiff
path: root/navit/navit_lfs.h
blob: 8d80654011c27870afc74fde2fa4adf45f6c16c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef __NAVIT_LFS_H__
/**
 * Navit, a modular navigation system.
 * Copyright (C) 2005-2014 Navit Team
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA.
 */

#ifdef BUFSIZ
#error "Don't #include stdio.h directly if you later #include navit_lfs.h"
#endif
#ifdef F_OK
#error "Don't #include unistd.h directly if you later #include navit_lfs.h"
#endif
#ifdef O_RDWR
#error "Don't #include unistd.h directly if you later #include navit_lfs.h"
#endif

#define _LARGEFILE_SOURCE
#define _FILE_OFFSET_BITS 64
#ifdef __MSVCRT__
#define __USE_MINGW_FSEEK
#endif

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

#ifdef __MSVCRT__

#undef lseek
#define lseek(fd,offset,whence) _lseeki64(fd,offset,whence)

#undef ftello
#define ftello(f) ftello64(f)

#undef fseeko
#define fseeko(f,offset,whence) fseeko64(f,offset,whence)

#undef off_t
#define off_t long long

#endif

#ifdef HAVE_API_ANDROID
#undef lseek
#define lseek lseek64
#endif

#ifndef O_LARGEFILE
#define O_LARGEFILE 0
#endif

#ifndef O_BINARY
#define O_BINARY 0
#endif

#define __NAVIT_LFS_H__
#endif