Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 1 | #ifndef Py_CONFIG_H |
| 2 | #define Py_CONFIG_H |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 3 | |
Tim Peters | 76f373d | 2001-07-26 21:34:59 +0000 | [diff] [blame] | 4 | /* pyconfig.h. NOT Generated automatically by configure. |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 5 | |
| 6 | This is a manually maintained version used for the Watcom, |
Walter Dörwald | f0dfc7a | 2003-10-20 14:01:56 +0000 | [diff] [blame] | 7 | Borland and Microsoft Visual C++ compilers. It is a |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 8 | standard part of the Python distribution. |
| 9 | |
Guido van Rossum | 950a126 | 1996-07-30 17:38:17 +0000 | [diff] [blame] | 10 | WINDOWS DEFINES: |
| 11 | The code specific to Windows should be wrapped around one of |
| 12 | the following #defines |
| 13 | |
Guido van Rossum | c66ae96 | 2000-05-08 14:14:48 +0000 | [diff] [blame] | 14 | MS_WIN64 - Code specific to the MS Win64 API |
Martin v. Löwis | 6238d2b | 2002-06-30 15:26:10 +0000 | [diff] [blame] | 15 | MS_WIN32 - Code specific to the MS Win32 (and Win64) API (obsolete, this covers all supported APIs) |
Guido van Rossum | 950a126 | 1996-07-30 17:38:17 +0000 | [diff] [blame] | 16 | MS_WINDOWS - Code specific to Windows, but all versions. |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 17 | Py_ENABLE_SHARED - Code if the Python core is built as a DLL. |
Guido van Rossum | 950a126 | 1996-07-30 17:38:17 +0000 | [diff] [blame] | 18 | |
| 19 | Also note that neither "_M_IX86" or "_MSC_VER" should be used for |
| 20 | any purpose other than "Windows Intel x86 specific" and "Microsoft |
| 21 | compiler specific". Therefore, these should be very rare. |
| 22 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 23 | |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 24 | NOTE: The following symbols are deprecated: |
| 25 | NT, WIN32, USE_DL_EXPORT, USE_DL_IMPORT, DL_EXPORT, DL_IMPORT |
| 26 | MS_CORE_DLL. |
Fred Drake | 91c4e2b | 2000-06-19 13:41:54 +0000 | [diff] [blame] | 27 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 28 | */ |
| 29 | |
Martin v. Löwis | e2a0602 | 2005-11-29 17:09:13 +0000 | [diff] [blame] | 30 | /* Visual Studio 2005 introduces deprecation warnings for |
| 31 | "insecure" and POSIX functions. The insecure functions should |
Walter Dörwald | 51490ac | 2005-11-30 20:16:17 +0000 | [diff] [blame] | 32 | be replaced by *_s versions (according to Microsoft); the |
Martin v. Löwis | e2a0602 | 2005-11-29 17:09:13 +0000 | [diff] [blame] | 33 | POSIX functions by _* versions (which, according to Microsoft, |
| 34 | would be ISO C conforming). Neither renaming is feasible, so |
| 35 | we just silence the warnings. */ |
| 36 | |
| 37 | #define _CRT_SECURE_NO_DEPRECATE 1 |
| 38 | #define _CRT_NONSTDC_NO_DEPRECATE 1 |
| 39 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 40 | #include <io.h> |
Tim Peters | 58e0a8c | 2001-05-14 22:32:33 +0000 | [diff] [blame] | 41 | #define HAVE_SYS_UTIME_H |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 42 | #define HAVE_HYPOT |
Fred Drake | 832181e | 2001-07-17 20:35:59 +0000 | [diff] [blame] | 43 | #define HAVE_TEMPNAM |
| 44 | #define HAVE_TMPFILE |
| 45 | #define HAVE_TMPNAM |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 46 | #define HAVE_CLOCK |
| 47 | #define HAVE_STRFTIME |
| 48 | #define HAVE_STRERROR |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 49 | #define DONT_HAVE_SIG_ALARM |
| 50 | #define DONT_HAVE_SIG_PAUSE |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 51 | #define LONG_BIT 32 |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 52 | #define WORD_BIT 32 |
Guido van Rossum | 950a126 | 1996-07-30 17:38:17 +0000 | [diff] [blame] | 53 | #define PREFIX "" |
| 54 | #define EXEC_PREFIX "" |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 55 | |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 56 | #define MS_WIN32 /* only support win32 and greater. */ |
| 57 | #define MS_WINDOWS |
| 58 | #ifndef PYTHONPATH |
| 59 | # define PYTHONPATH ".\\DLLs;.\\lib;.\\lib\\plat-win;.\\lib\\lib-tk" |
| 60 | #endif |
| 61 | #define NT_THREADS |
| 62 | #define WITH_THREAD |
| 63 | #ifndef NETSCAPE_PI |
| 64 | #define USE_SOCKET |
| 65 | #endif |
| 66 | |
| 67 | /* Compiler specific defines */ |
| 68 | |
| 69 | /* ------------------------------------------------------------------------*/ |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 70 | /* Microsoft C defines _MSC_VER */ |
Guido van Rossum | c66ae96 | 2000-05-08 14:14:48 +0000 | [diff] [blame] | 71 | #ifdef _MSC_VER |
| 72 | |
Tim Peters | 0628433 | 2002-11-11 19:44:39 +0000 | [diff] [blame] | 73 | /* We want COMPILER to expand to a string containing _MSC_VER's *value*. |
| 74 | * This is horridly tricky, because the stringization operator only works |
| 75 | * on macro arguments, and doesn't evaluate macros passed *as* arguments. |
| 76 | * Attempts simpler than the following appear doomed to produce "_MSC_VER" |
| 77 | * literally in the string. |
| 78 | */ |
| 79 | #define _Py_PASTE_VERSION(SUFFIX) \ |
| 80 | ("[MSC v." _Py_STRINGIZE(_MSC_VER) " " SUFFIX "]") |
| 81 | /* e.g., this produces, after compile-time string catenation, |
| 82 | * ("[MSC v.1200 32 bit (Intel)]") |
| 83 | * |
| 84 | * _Py_STRINGIZE(_MSC_VER) expands to |
| 85 | * _Py_STRINGIZE1((_MSC_VER)) expands to |
| 86 | * _Py_STRINGIZE2(_MSC_VER) but as this call is the result of token-pasting |
| 87 | * it's scanned again for macros and so further expands to (under MSVC 6) |
| 88 | * _Py_STRINGIZE2(1200) which then expands to |
| 89 | * "1200" |
| 90 | */ |
| 91 | #define _Py_STRINGIZE(X) _Py_STRINGIZE1((X)) |
| 92 | #define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X |
| 93 | #define _Py_STRINGIZE2(X) #X |
| 94 | |
Guido van Rossum | c66ae96 | 2000-05-08 14:14:48 +0000 | [diff] [blame] | 95 | /* MSVC defines _WINxx to differentiate the windows platform types |
| 96 | |
| 97 | Note that for compatibility reasons _WIN32 is defined on Win32 |
| 98 | *and* on Win64. For the same reasons, in Python, MS_WIN32 is |
| 99 | defined on Win32 *and* Win64. Win32 only code must therefore be |
| 100 | guarded as follows: |
| 101 | #if defined(MS_WIN32) && !defined(MS_WIN64) |
| 102 | */ |
| 103 | #ifdef _WIN64 |
| 104 | #define MS_WIN64 |
| 105 | #endif |
Guido van Rossum | c66ae96 | 2000-05-08 14:14:48 +0000 | [diff] [blame] | 106 | |
| 107 | /* set the COMPILER */ |
| 108 | #ifdef MS_WIN64 |
| 109 | #ifdef _M_IX86 |
Tim Peters | c7ff90b | 2002-11-11 20:21:06 +0000 | [diff] [blame] | 110 | #define COMPILER _Py_PASTE_VERSION("64 bit (Intel)") |
Martin v. Löwis | 512efb4 | 2004-07-27 14:16:14 +0000 | [diff] [blame] | 111 | #elif defined(_M_IA64) |
| 112 | #define COMPILER _Py_PASTE_VERSION("64 bit (Itanium)") |
| 113 | #elif defined(_M_AMD64) |
| 114 | #define COMPILER _Py_PASTE_VERSION("64 bit (AMD64)") |
Guido van Rossum | c66ae96 | 2000-05-08 14:14:48 +0000 | [diff] [blame] | 115 | #else |
Tim Peters | 0628433 | 2002-11-11 19:44:39 +0000 | [diff] [blame] | 116 | #define COMPILER _Py_PASTE_VERSION("64 bit (Unknown)") |
Guido van Rossum | c66ae96 | 2000-05-08 14:14:48 +0000 | [diff] [blame] | 117 | #endif |
| 118 | #endif /* MS_WIN64 */ |
| 119 | |
| 120 | #if defined(MS_WIN32) && !defined(MS_WIN64) |
| 121 | #ifdef _M_IX86 |
Tim Peters | 0628433 | 2002-11-11 19:44:39 +0000 | [diff] [blame] | 122 | #define COMPILER _Py_PASTE_VERSION("32 bit (Intel)") |
Guido van Rossum | c66ae96 | 2000-05-08 14:14:48 +0000 | [diff] [blame] | 123 | #else |
Tim Peters | 0628433 | 2002-11-11 19:44:39 +0000 | [diff] [blame] | 124 | #define COMPILER _Py_PASTE_VERSION("32 bit (Unknown)") |
Guido van Rossum | c66ae96 | 2000-05-08 14:14:48 +0000 | [diff] [blame] | 125 | #endif |
| 126 | #endif /* MS_WIN32 && !MS_WIN64 */ |
| 127 | |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 128 | typedef int pid_t; |
| 129 | #define hypot _hypot |
| 130 | |
Tim Peters | 862f059 | 2004-09-23 19:11:32 +0000 | [diff] [blame] | 131 | #include <float.h> |
| 132 | #define Py_IS_NAN _isnan |
| 133 | #define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X)) |
| 134 | |
Guido van Rossum | c66ae96 | 2000-05-08 14:14:48 +0000 | [diff] [blame] | 135 | #endif /* _MSC_VER */ |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 136 | |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 137 | /* define some ANSI types that are not defined in earlier Win headers */ |
| 138 | #if defined(_MSC_VER) && _MSC_VER >= 1200 |
| 139 | /* This file only exists in VC 6.0 or higher */ |
| 140 | #include <basetsd.h> |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 141 | #endif |
Guido van Rossum | 950a126 | 1996-07-30 17:38:17 +0000 | [diff] [blame] | 142 | |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 143 | /* ------------------------------------------------------------------------*/ |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 144 | /* The Borland compiler defines __BORLANDC__ */ |
Guido van Rossum | cf6c0ea | 1996-10-21 14:52:24 +0000 | [diff] [blame] | 145 | /* XXX These defines are likely incomplete, but should be easy to fix. */ |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 146 | #ifdef __BORLANDC__ |
| 147 | #define COMPILER "[Borland]" |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 148 | |
| 149 | #ifdef _WIN32 |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 150 | /* tested with BCC 5.5 (__BORLANDC__ >= 0x0550) |
| 151 | */ |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 152 | |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 153 | typedef int pid_t; |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 154 | /* BCC55 seems to understand __declspec(dllimport), it is used in its |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 155 | own header files (winnt.h, ...) - so we can do nothing and get the default*/ |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 156 | |
Tim Peters | 58e0a8c | 2001-05-14 22:32:33 +0000 | [diff] [blame] | 157 | #undef HAVE_SYS_UTIME_H |
| 158 | #define HAVE_UTIME_H |
| 159 | #define HAVE_DIRENT_H |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 160 | |
| 161 | /* rename a few functions for the Borland compiler */ |
| 162 | #include <io.h> |
| 163 | #define _chsize chsize |
| 164 | #define _setmode setmode |
Tim Peters | 7f00deb | 2001-04-21 03:20:47 +0000 | [diff] [blame] | 165 | |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 166 | #else /* !_WIN32 */ |
Guido van Rossum | 6042741 | 2000-11-13 17:29:30 +0000 | [diff] [blame] | 167 | #error "Only Win32 and later are supported" |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 168 | #endif /* !_WIN32 */ |
| 169 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 170 | #endif /* BORLANDC */ |
| 171 | |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 172 | /* ------------------------------------------------------------------------*/ |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 173 | /* egcs/gnu-win32 defines __GNUC__ and _WIN32 */ |
| 174 | #if defined(__GNUC__) && defined(_WIN32) |
Tim Peters | b26f363 | 2002-03-22 06:32:32 +0000 | [diff] [blame] | 175 | /* XXX These defines are likely incomplete, but should be easy to fix. |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 176 | They should be complete enough to build extension modules. */ |
| 177 | /* Suggested by Rene Liebscher <R.Liebscher@gmx.de> to avoid a GCC 2.91.* |
| 178 | bug that requires structure imports. More recent versions of the |
| 179 | compiler don't exhibit this bug. |
| 180 | */ |
| 181 | #if (__GNUC__==2) && (__GNUC_MINOR__<=91) |
| 182 | #warning "Please use an up-to-date version of gcc! (>2.91 recommended)" |
| 183 | #endif |
| 184 | |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 185 | #define COMPILER "[gcc]" |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 186 | #define hypot _hypot |
Martin v. Löwis | b9a0f91 | 2003-03-29 10:06:18 +0000 | [diff] [blame] | 187 | #define PY_LONG_LONG long long |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 188 | #endif /* GNUC */ |
| 189 | |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 190 | /* ------------------------------------------------------------------------*/ |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 191 | /* lcc-win32 defines __LCC__ */ |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 192 | #if defined(__LCC__) |
Tim Peters | b26f363 | 2002-03-22 06:32:32 +0000 | [diff] [blame] | 193 | /* XXX These defines are likely incomplete, but should be easy to fix. |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 194 | They should be complete enough to build extension modules. */ |
| 195 | |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 196 | #define COMPILER "[lcc-win32]" |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 197 | typedef int pid_t; |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 198 | /* __declspec() is supported here too - do nothing to get the defaults */ |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 199 | |
Mark Hammond | c756bdb | 2000-08-15 22:33:59 +0000 | [diff] [blame] | 200 | #endif /* LCC */ |
| 201 | |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 202 | /* ------------------------------------------------------------------------*/ |
Guido van Rossum | 950a126 | 1996-07-30 17:38:17 +0000 | [diff] [blame] | 203 | /* End of compilers - finish up */ |
| 204 | |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 205 | #ifndef NO_STDIO_H |
| 206 | # include <stdio.h> |
Guido van Rossum | 361b583 | 2000-06-30 22:17:53 +0000 | [diff] [blame] | 207 | #endif |
Fred Drake | a3f6e91 | 2000-06-29 20:44:47 +0000 | [diff] [blame] | 208 | |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 209 | /* 64 bit ints are usually spelt __int64 unless compiler has overridden */ |
| 210 | #define HAVE_LONG_LONG 1 |
Martin v. Löwis | b9a0f91 | 2003-03-29 10:06:18 +0000 | [diff] [blame] | 211 | #ifndef PY_LONG_LONG |
| 212 | # define PY_LONG_LONG __int64 |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 213 | #endif |
| 214 | |
Tim Peters | 0628433 | 2002-11-11 19:44:39 +0000 | [diff] [blame] | 215 | /* For Windows the Python core is in a DLL by default. Test |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 216 | Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ |
| 217 | #if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED) |
| 218 | # define Py_ENABLE_SHARED 1 /* standard symbol for shared library */ |
| 219 | # define MS_COREDLL /* deprecated old symbol */ |
| 220 | #endif /* !MS_NO_COREDLL && ... */ |
| 221 | |
| 222 | /* Deprecated USE_DL_EXPORT macro - please use Py_BUILD_CORE */ |
| 223 | #ifdef USE_DL_EXPORT |
| 224 | # define Py_BUILD_CORE |
| 225 | #endif /* USE_DL_EXPORT */ |
| 226 | |
| 227 | /* All windows compilers that use this header support __declspec */ |
| 228 | #define HAVE_DECLSPEC_DLL |
| 229 | |
| 230 | /* For an MSVC DLL, we can nominate the .lib files used by extensions */ |
| 231 | #ifdef MS_COREDLL |
| 232 | # ifndef Py_BUILD_CORE /* not building the core - must be an ext */ |
| 233 | # if defined(_MSC_VER) |
Tim Peters | 0628433 | 2002-11-11 19:44:39 +0000 | [diff] [blame] | 234 | /* So MSVC users need not specify the .lib file in |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 235 | their Makefile (other compilers are generally |
| 236 | taken care of by distutils.) */ |
| 237 | # ifdef _DEBUG |
Thomas Heller | 6ad6ee6 | 2004-12-01 19:39:52 +0000 | [diff] [blame] | 238 | # pragma comment(lib,"python25_d.lib") |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 239 | # else |
Thomas Heller | 6ad6ee6 | 2004-12-01 19:39:52 +0000 | [diff] [blame] | 240 | # pragma comment(lib,"python25.lib") |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 241 | # endif /* _DEBUG */ |
| 242 | # endif /* _MSC_VER */ |
| 243 | # endif /* Py_BUILD_CORE */ |
| 244 | #endif /* MS_COREDLL */ |
| 245 | |
Guido van Rossum | c66ae96 | 2000-05-08 14:14:48 +0000 | [diff] [blame] | 246 | #if defined(MS_WIN64) |
Guido van Rossum | da5cc82 | 2000-05-10 13:25:32 +0000 | [diff] [blame] | 247 | /* maintain "win32" sys.platform for backward compatibility of Python code, |
| 248 | the Win64 API should be close enough to the Win32 API to make this |
| 249 | preferable */ |
Fred Drake | a3f6e91 | 2000-06-29 20:44:47 +0000 | [diff] [blame] | 250 | # define PLATFORM "win32" |
| 251 | # define SIZEOF_VOID_P 8 |
| 252 | # define SIZEOF_TIME_T 8 |
| 253 | # define SIZEOF_OFF_T 4 |
| 254 | # define SIZEOF_FPOS_T 8 |
| 255 | # define SIZEOF_HKEY 8 |
| 256 | /* configure.in defines HAVE_LARGEFILE_SUPPORT iff HAVE_LONG_LONG, |
Martin v. Löwis | b9a0f91 | 2003-03-29 10:06:18 +0000 | [diff] [blame] | 257 | sizeof(off_t) > sizeof(long), and sizeof(PY_LONG_LONG) >= sizeof(off_t). |
Fred Drake | a3f6e91 | 2000-06-29 20:44:47 +0000 | [diff] [blame] | 258 | On Win64 the second condition is not true, but if fpos_t replaces off_t |
| 259 | then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64 |
| 260 | should define this. */ |
| 261 | # define HAVE_LARGEFILE_SUPPORT |
Guido van Rossum | c66ae96 | 2000-05-08 14:14:48 +0000 | [diff] [blame] | 262 | #elif defined(MS_WIN32) |
Fred Drake | a3f6e91 | 2000-06-29 20:44:47 +0000 | [diff] [blame] | 263 | # define PLATFORM "win32" |
Tim Peters | 6e13a56 | 2001-09-06 00:32:15 +0000 | [diff] [blame] | 264 | # define HAVE_LARGEFILE_SUPPORT |
Tim Peters | 0628433 | 2002-11-11 19:44:39 +0000 | [diff] [blame] | 265 | # define SIZEOF_VOID_P 4 |
| 266 | # define SIZEOF_TIME_T 4 |
| 267 | # define SIZEOF_OFF_T 4 |
| 268 | # define SIZEOF_FPOS_T 8 |
| 269 | # define SIZEOF_HKEY 4 |
Guido van Rossum | c66ae96 | 2000-05-08 14:14:48 +0000 | [diff] [blame] | 270 | #endif |
| 271 | |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 272 | #ifdef _DEBUG |
| 273 | # define Py_DEBUG |
| 274 | #endif |
| 275 | |
Guido van Rossum | 950a126 | 1996-07-30 17:38:17 +0000 | [diff] [blame] | 276 | |
Guido van Rossum | f4aeb84 | 1998-02-19 20:59:23 +0000 | [diff] [blame] | 277 | #ifdef MS_WIN32 |
Guido van Rossum | d3ab101 | 1998-05-29 02:53:29 +0000 | [diff] [blame] | 278 | |
Tim Peters | 208efe5 | 2001-06-26 22:40:47 +0000 | [diff] [blame] | 279 | #define SIZEOF_SHORT 2 |
Guido van Rossum | d3ab101 | 1998-05-29 02:53:29 +0000 | [diff] [blame] | 280 | #define SIZEOF_INT 4 |
| 281 | #define SIZEOF_LONG 4 |
Guido van Rossum | b00d252 | 1998-09-17 13:19:36 +0000 | [diff] [blame] | 282 | #define SIZEOF_LONG_LONG 8 |
Guido van Rossum | d3ab101 | 1998-05-29 02:53:29 +0000 | [diff] [blame] | 283 | |
Raymond Hettinger | cbcff93 | 2004-08-03 08:52:46 +0000 | [diff] [blame] | 284 | /* VC 7.1 has them and VC 6.0 does not. VC 6.0 has a version number of 1200. |
| 285 | If some compiler does not provide them, modify the #if appropriately. */ |
Martin v. Löwis | 15b23a0 | 2004-10-15 04:26:18 +0000 | [diff] [blame] | 286 | #if defined(_MSC_VER) |
| 287 | #if _MSC_VER > 1200 |
Martin v. Löwis | fe393f4 | 2004-07-27 15:57:24 +0000 | [diff] [blame] | 288 | #define HAVE_UINTPTR_T 1 |
| 289 | #define HAVE_INTPTR_T 1 |
Martin v. Löwis | 15b23a0 | 2004-10-15 04:26:18 +0000 | [diff] [blame] | 290 | #endif /* _MSC_VER > 1200 */ |
| 291 | #endif /* _MSC_VER */ |
Martin v. Löwis | fe393f4 | 2004-07-27 15:57:24 +0000 | [diff] [blame] | 292 | |
Guido van Rossum | f4aeb84 | 1998-02-19 20:59:23 +0000 | [diff] [blame] | 293 | #endif |
| 294 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 295 | /* Fairly standard from here! */ |
| 296 | |
| 297 | /* Define if on AIX 3. |
| 298 | System headers sometimes define this. |
| 299 | We just want to avoid a redefinition error message. */ |
| 300 | #ifndef _ALL_SOURCE |
| 301 | /* #undef _ALL_SOURCE */ |
| 302 | #endif |
| 303 | |
| 304 | /* Define to empty if the keyword does not work. */ |
| 305 | /* #define const */ |
| 306 | |
| 307 | /* Define if you have dirent.h. */ |
| 308 | /* #define DIRENT 1 */ |
| 309 | |
| 310 | /* Define to the type of elements in the array set by `getgroups'. |
| 311 | Usually this is either `int' or `gid_t'. */ |
| 312 | /* #undef GETGROUPS_T */ |
| 313 | |
| 314 | /* Define to `int' if <sys/types.h> doesn't define. */ |
| 315 | /* #undef gid_t */ |
| 316 | |
| 317 | /* Define if your struct tm has tm_zone. */ |
| 318 | /* #undef HAVE_TM_ZONE */ |
| 319 | |
| 320 | /* Define if you don't have tm_zone but do have the external array |
| 321 | tzname. */ |
| 322 | #define HAVE_TZNAME |
| 323 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 324 | /* Define to `int' if <sys/types.h> doesn't define. */ |
| 325 | /* #undef mode_t */ |
| 326 | |
| 327 | /* Define if you don't have dirent.h, but have ndir.h. */ |
| 328 | /* #undef NDIR */ |
| 329 | |
| 330 | /* Define to `long' if <sys/types.h> doesn't define. */ |
| 331 | /* #undef off_t */ |
| 332 | |
| 333 | /* Define to `int' if <sys/types.h> doesn't define. */ |
| 334 | /* #undef pid_t */ |
| 335 | |
| 336 | /* Define if the system does not provide POSIX.1 features except |
| 337 | with this defined. */ |
| 338 | /* #undef _POSIX_1_SOURCE */ |
| 339 | |
| 340 | /* Define if you need to in order for stat and other things to work. */ |
| 341 | /* #undef _POSIX_SOURCE */ |
| 342 | |
| 343 | /* Define as the return type of signal handlers (int or void). */ |
| 344 | #define RETSIGTYPE void |
| 345 | |
| 346 | /* Define to `unsigned' if <sys/types.h> doesn't define. */ |
| 347 | /* #undef size_t */ |
| 348 | |
Guido van Rossum | db575db | 2000-04-24 15:37:34 +0000 | [diff] [blame] | 349 | /* Define to `int' if <sys/types.h> doesn't define. */ |
Martin v. Löwis | 272cb40 | 2002-03-01 08:31:07 +0000 | [diff] [blame] | 350 | #if _MSC_VER + 0 >= 1300 |
| 351 | /* VC.NET typedefs socklen_t in ws2tcpip.h. */ |
| 352 | #else |
Guido van Rossum | db575db | 2000-04-24 15:37:34 +0000 | [diff] [blame] | 353 | #define socklen_t int |
Martin v. Löwis | 272cb40 | 2002-03-01 08:31:07 +0000 | [diff] [blame] | 354 | #endif |
Guido van Rossum | db575db | 2000-04-24 15:37:34 +0000 | [diff] [blame] | 355 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 356 | /* Define if you have the ANSI C header files. */ |
| 357 | #define STDC_HEADERS 1 |
| 358 | |
| 359 | /* Define if you don't have dirent.h, but have sys/dir.h. */ |
| 360 | /* #undef SYSDIR */ |
| 361 | |
| 362 | /* Define if you don't have dirent.h, but have sys/ndir.h. */ |
| 363 | /* #undef SYSNDIR */ |
| 364 | |
| 365 | /* Define if you can safely include both <sys/time.h> and <time.h>. */ |
| 366 | /* #undef TIME_WITH_SYS_TIME */ |
| 367 | |
| 368 | /* Define if your <sys/time.h> declares struct tm. */ |
| 369 | /* #define TM_IN_SYS_TIME 1 */ |
| 370 | |
| 371 | /* Define to `int' if <sys/types.h> doesn't define. */ |
| 372 | /* #undef uid_t */ |
| 373 | |
| 374 | /* Define if the closedir function returns void instead of int. */ |
| 375 | /* #undef VOID_CLOSEDIR */ |
| 376 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 377 | /* Define if getpgrp() must be called as getpgrp(0) |
| 378 | and (consequently) setpgrp() as setpgrp(0, 0). */ |
| 379 | /* #undef GETPGRP_HAVE_ARGS */ |
| 380 | |
| 381 | /* Define this if your time.h defines altzone */ |
| 382 | /* #define HAVE_ALTZONE */ |
| 383 | |
Guido van Rossum | eaf9b6c | 1996-08-22 00:06:59 +0000 | [diff] [blame] | 384 | /* Define if you have the putenv function. */ |
Guido van Rossum | eaf9b6c | 1996-08-22 00:06:59 +0000 | [diff] [blame] | 385 | #define HAVE_PUTENV |
Guido van Rossum | eaf9b6c | 1996-08-22 00:06:59 +0000 | [diff] [blame] | 386 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 387 | /* Define if your compiler supports function prototypes */ |
| 388 | #define HAVE_PROTOTYPES |
| 389 | |
| 390 | /* Define if you can safely include both <sys/select.h> and <sys/time.h> |
| 391 | (which you can't on SCO ODT 3.0). */ |
| 392 | /* #undef SYS_SELECT_WITH_SYS_TIME */ |
| 393 | |
Martin v. Löwis | 2befa48 | 2002-06-09 13:41:37 +0000 | [diff] [blame] | 394 | /* Define if you want documentation strings in extension modules */ |
| 395 | #define WITH_DOC_STRINGS 1 |
| 396 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 397 | /* Define if you want to compile in rudimentary thread support */ |
| 398 | /* #undef WITH_THREAD */ |
| 399 | |
| 400 | /* Define if you want to use the GNU readline library */ |
| 401 | /* #define WITH_READLINE 1 */ |
| 402 | |
Fredrik Lundh | 9b14ab3 | 2001-06-26 22:59:49 +0000 | [diff] [blame] | 403 | /* Define if you want to have a Unicode type. */ |
| 404 | #define Py_USING_UNICODE |
| 405 | |
| 406 | /* Define as the integral type used for Unicode representation. */ |
| 407 | #define PY_UNICODE_TYPE unsigned short |
| 408 | |
| 409 | /* Define as the size of the unicode type. */ |
| 410 | #define Py_UNICODE_SIZE SIZEOF_SHORT |
| 411 | |
Fredrik Lundh | 793c197 | 2001-06-27 19:49:17 +0000 | [diff] [blame] | 412 | /* Define if you have a useable wchar_t type defined in wchar.h; useable |
| 413 | means wchar_t must be 16-bit unsigned type. (see |
| 414 | Include/unicodeobject.h). */ |
| 415 | #if Py_UNICODE_SIZE == 2 |
| 416 | #define HAVE_USABLE_WCHAR_T |
Mark Hammond | c2e85bd | 2002-10-03 05:10:39 +0000 | [diff] [blame] | 417 | |
| 418 | /* Define to indicate that the Python Unicode representation can be passed |
| 419 | as-is to Win32 Wide API. */ |
| 420 | #define Py_WIN_WIDE_FILENAMES |
Fredrik Lundh | 793c197 | 2001-06-27 19:49:17 +0000 | [diff] [blame] | 421 | #endif |
| 422 | |
Tim Peters | b26f363 | 2002-03-22 06:32:32 +0000 | [diff] [blame] | 423 | /* Use Python's own small-block memory-allocator. */ |
| 424 | #define WITH_PYMALLOC 1 |
| 425 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 426 | /* Define if you have clock. */ |
| 427 | /* #define HAVE_CLOCK */ |
| 428 | |
Guido van Rossum | 9f9fa6d | 1999-12-20 22:57:41 +0000 | [diff] [blame] | 429 | /* Define when any dynamic module loading is enabled */ |
| 430 | #define HAVE_DYNAMIC_LOADING |
| 431 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 432 | /* Define if you have ftime. */ |
| 433 | #define HAVE_FTIME |
| 434 | |
| 435 | /* Define if you have getpeername. */ |
Guido van Rossum | c339753 | 1997-05-06 15:58:18 +0000 | [diff] [blame] | 436 | #define HAVE_GETPEERNAME |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 437 | |
| 438 | /* Define if you have getpgrp. */ |
| 439 | /* #undef HAVE_GETPGRP */ |
| 440 | |
| 441 | /* Define if you have getpid. */ |
Guido van Rossum | c339753 | 1997-05-06 15:58:18 +0000 | [diff] [blame] | 442 | #define HAVE_GETPID |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 443 | |
| 444 | /* Define if you have gettimeofday. */ |
| 445 | /* #undef HAVE_GETTIMEOFDAY */ |
| 446 | |
| 447 | /* Define if you have getwd. */ |
| 448 | /* #undef HAVE_GETWD */ |
| 449 | |
| 450 | /* Define if you have lstat. */ |
| 451 | /* #undef HAVE_LSTAT */ |
| 452 | |
Guido van Rossum | 63096d4 | 1998-04-10 21:28:49 +0000 | [diff] [blame] | 453 | /* Define if you have the mktime function. */ |
| 454 | #define HAVE_MKTIME |
| 455 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 456 | /* Define if you have nice. */ |
| 457 | /* #undef HAVE_NICE */ |
| 458 | |
| 459 | /* Define if you have readlink. */ |
| 460 | /* #undef HAVE_READLINK */ |
| 461 | |
| 462 | /* Define if you have select. */ |
| 463 | /* #undef HAVE_SELECT */ |
| 464 | |
| 465 | /* Define if you have setpgid. */ |
| 466 | /* #undef HAVE_SETPGID */ |
| 467 | |
| 468 | /* Define if you have setpgrp. */ |
| 469 | /* #undef HAVE_SETPGRP */ |
| 470 | |
| 471 | /* Define if you have setsid. */ |
| 472 | /* #undef HAVE_SETSID */ |
| 473 | |
Guido van Rossum | c339753 | 1997-05-06 15:58:18 +0000 | [diff] [blame] | 474 | /* Define if you have setvbuf. */ |
| 475 | #define HAVE_SETVBUF |
| 476 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 477 | /* Define if you have siginterrupt. */ |
| 478 | /* #undef HAVE_SIGINTERRUPT */ |
| 479 | |
| 480 | /* Define if you have symlink. */ |
| 481 | /* #undef HAVE_SYMLINK */ |
| 482 | |
| 483 | /* Define if you have tcgetpgrp. */ |
| 484 | /* #undef HAVE_TCGETPGRP */ |
| 485 | |
| 486 | /* Define if you have tcsetpgrp. */ |
| 487 | /* #undef HAVE_TCSETPGRP */ |
| 488 | |
| 489 | /* Define if you have times. */ |
| 490 | /* #undef HAVE_TIMES */ |
| 491 | |
| 492 | /* Define if you have uname. */ |
| 493 | /* #undef HAVE_UNAME */ |
| 494 | |
| 495 | /* Define if you have waitpid. */ |
| 496 | /* #undef HAVE_WAITPID */ |
| 497 | |
Martin v. Löwis | 9c36c29 | 2002-12-21 18:34:06 +0000 | [diff] [blame] | 498 | /* Define to 1 if you have the `wcscoll' function. */ |
| 499 | #define HAVE_WCSCOLL 1 |
| 500 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 501 | /* Define if you have the <dlfcn.h> header file. */ |
| 502 | /* #undef HAVE_DLFCN_H */ |
| 503 | |
| 504 | /* Define if you have the <fcntl.h> header file. */ |
| 505 | #define HAVE_FCNTL_H 1 |
| 506 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 507 | /* Define if you have the <stdarg.h> prototypes. */ |
| 508 | #define HAVE_STDARG_PROTOTYPES |
| 509 | |
Martin v. Löwis | fe393f4 | 2004-07-27 15:57:24 +0000 | [diff] [blame] | 510 | /* Define if you have the <stddef.h> header file. */ |
| 511 | #define HAVE_STDDEF_H 1 |
| 512 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 513 | /* Define if you have the <sys/audioio.h> header file. */ |
| 514 | /* #undef HAVE_SYS_AUDIOIO_H */ |
| 515 | |
| 516 | /* Define if you have the <sys/param.h> header file. */ |
| 517 | /* #define HAVE_SYS_PARAM_H 1 */ |
| 518 | |
| 519 | /* Define if you have the <sys/select.h> header file. */ |
| 520 | /* #define HAVE_SYS_SELECT_H 1 */ |
| 521 | |
| 522 | /* Define if you have the <sys/time.h> header file. */ |
| 523 | /* #define HAVE_SYS_TIME_H 1 */ |
| 524 | |
| 525 | /* Define if you have the <sys/times.h> header file. */ |
| 526 | /* #define HAVE_SYS_TIMES_H 1 */ |
| 527 | |
| 528 | /* Define if you have the <sys/un.h> header file. */ |
| 529 | /* #define HAVE_SYS_UN_H 1 */ |
| 530 | |
| 531 | /* Define if you have the <sys/utime.h> header file. */ |
Tim Peters | 58e0a8c | 2001-05-14 22:32:33 +0000 | [diff] [blame] | 532 | /* #define HAVE_SYS_UTIME_H 1 */ |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 533 | |
| 534 | /* Define if you have the <sys/utsname.h> header file. */ |
| 535 | /* #define HAVE_SYS_UTSNAME_H 1 */ |
| 536 | |
| 537 | /* Define if you have the <thread.h> header file. */ |
| 538 | /* #undef HAVE_THREAD_H */ |
| 539 | |
| 540 | /* Define if you have the <unistd.h> header file. */ |
| 541 | /* #define HAVE_UNISTD_H 1 */ |
| 542 | |
| 543 | /* Define if you have the <utime.h> header file. */ |
| 544 | /* #define HAVE_UTIME_H 1 */ |
| 545 | |
Martin v. Löwis | 9c36c29 | 2002-12-21 18:34:06 +0000 | [diff] [blame] | 546 | /* Define if the compiler provides a wchar.h header file. */ |
| 547 | #define HAVE_WCHAR_H 1 |
| 548 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 549 | /* Define if you have the dl library (-ldl). */ |
| 550 | /* #undef HAVE_LIBDL */ |
| 551 | |
| 552 | /* Define if you have the mpc library (-lmpc). */ |
| 553 | /* #undef HAVE_LIBMPC */ |
| 554 | |
| 555 | /* Define if you have the nsl library (-lnsl). */ |
| 556 | #define HAVE_LIBNSL 1 |
| 557 | |
| 558 | /* Define if you have the seq library (-lseq). */ |
| 559 | /* #undef HAVE_LIBSEQ */ |
| 560 | |
| 561 | /* Define if you have the socket library (-lsocket). */ |
| 562 | #define HAVE_LIBSOCKET 1 |
| 563 | |
| 564 | /* Define if you have the sun library (-lsun). */ |
| 565 | /* #undef HAVE_LIBSUN */ |
| 566 | |
| 567 | /* Define if you have the termcap library (-ltermcap). */ |
| 568 | /* #undef HAVE_LIBTERMCAP */ |
| 569 | |
| 570 | /* Define if you have the termlib library (-ltermlib). */ |
| 571 | /* #undef HAVE_LIBTERMLIB */ |
| 572 | |
| 573 | /* Define if you have the thread library (-lthread). */ |
| 574 | /* #undef HAVE_LIBTHREAD */ |
Martin v. Löwis | f84d1b9 | 2006-02-11 09:27:05 +0000 | [diff] [blame^] | 575 | |
| 576 | /* WinSock does not use a bitmask in select, and uses |
| 577 | socket handles greater than FD_SETSIZE */ |
| 578 | #define Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE |
| 579 | |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 580 | #endif /* !Py_CONFIG_H */ |