comparison src/define.h @ 118:0f1492b7fe8b

patch from Fridrich Strba for building on mingw and general cleanup of autoconf files add processing for pst files of type 0x0f start adding support for properly building and installing libpst.so and the header files required to use it. remove version.h since the version number is now in config.h more const correctness issues regarding getopt()
author Carl Byington <carl@five-ten-sg.com>
date Sat, 31 Jan 2009 12:12:36 -0800
parents 987aa872294e
children 6395ced2b8b2
comparison
equal deleted inserted replaced
117:0a3d854b53f6 118:0f1492b7fe8b
4 * Written by David Smith 4 * Written by David Smith
5 * dave.s@earthcorp.com 5 * dave.s@earthcorp.com
6 */ 6 */
7 7
8 #ifdef HAVE_CONFIG_H 8 #ifdef HAVE_CONFIG_H
9 #include "config.h" 9 #include <libpst/config.h>
10 #else 10 #endif
11 #ifdef _MSC_VER 11
12 #undef HAVE_UNISTD_H 12 #ifdef _WIN32
13 #define HAVE_DIRECT_H 13 #undef HAVE_UNISTD_H
14 #define HAVE_WINDOWS_H 14 #define HAVE_DIRECT_H
15 #endif 15 #define HAVE_WINDOWS_H
16 #endif 16 #endif
17 #include "version.h"
18 17
19 #ifndef DEFINEH_H 18 #ifndef DEFINEH_H
20 #define DEFINEH_H 19 #define DEFINEH_H
21 20
22 #define DEBUG_MODE_GEN 21 #define DEBUG_MODE_GEN
57 #include <signal.h> 56 #include <signal.h>
58 #include <errno.h> 57 #include <errno.h>
59 58
60 #define PERM_DIRS 0777 59 #define PERM_DIRS 0777
61 60
62 #ifdef HAVE_UNISTD_H 61 #ifdef _WIN32
63 #include <unistd.h> 62 #include <direct.h> // win32
64 #define D_MKDIR(x) mkdir(x, PERM_DIRS) 63
65 #else 64 #define D_MKDIR(x) mkdir(x)
66 #include "XGetopt.h" 65 #define chdir _chdir
67 #ifdef HAVE_DIRECT_H 66
68 #include <direct.h> // win32 67 #define vsnprintf _vsnprintf
69 #define D_MKDIR(x) mkdir(x) 68 #define snprintf _snprintf
70 #define chdir _chdir
71 #endif
72
73 #ifdef HAVE_WINDOWS_H
74 #include <windows.h>
75 #endif
76
77 #ifdef _MSC_VER 69 #ifdef _MSC_VER
78 #define vsnprintf _vsnprintf
79 #define snprintf _snprintf
80 #define ftello _ftelli64 70 #define ftello _ftelli64
81 #define fseeko _fseeki64 71 #define fseeko _fseeki64
82 #define strcasecmp _stricmp 72 #elif defined (__MINGW32__)
73 #define ftello ftello64
74 #define fseeko fseeko64
75 #else
76 #error Only MSC and mingw supported for Windows
77 #endif
78 #define strcasecmp _stricmp
79 #ifndef __MINGW32__
83 #define off_t __int64 80 #define off_t __int64
84 #define size_t __int64 81 #define size_t __int64
85 #define int64_t __int64 82 #endif
86 #define uint64_t unsigned __int64 83 #define int64_t __int64
87 #define int32_t __int32 84 #define uint64_t unsigned __int64
88 #define uint32_t unsigned int 85 #define int32_t __int32
89 #define int16_t short int 86 #define uint32_t unsigned int
90 #define uint16_t unsigned short int 87 #define int16_t short int
91 #define int8_t signed char 88 #define uint16_t unsigned short int
92 #define uint8_t unsigned char 89 #define int8_t signed char
90 #define uint8_t unsigned char
91 #ifndef UINT64_MAX
93 #define UINT64_MAX ((uint64_t)0xffffffffffffffff) 92 #define UINT64_MAX ((uint64_t)0xffffffffffffffff)
94 int __cdecl _fseeki64(FILE *, __int64, int); 93 #endif
95 __int64 __cdecl _ftelli64(FILE *); 94 #define PRIx64 "I64x"
95 int __cdecl _fseeki64(FILE *, __int64, int);
96 __int64 __cdecl _ftelli64(FILE *);
97
98 #ifdef __MINGW32__
99 #include <getopt.h>
100 #else
101 #include "XGetopt.h"
102 #endif
103
104 #include <windows.h>
105 #else
106 #ifdef HAVE_INTTYPES_H
107 #include <inttypes.h>
108 #endif
109 #ifdef HAVE_UNISTD_H
110 #include <unistd.h>
111 #define D_MKDIR(x) mkdir(x, PERM_DIRS)
112 #else
113 #include "XGetopt.h"
96 #endif 114 #endif
97 #endif 115 #endif
98 116
99 #ifdef HAVE_SYS_STAT_H 117 #ifdef HAVE_SYS_STAT_H
100 #include <sys/stat.h> 118 #include <sys/stat.h>