4 /* pyconfig.h. NOT Generated automatically by configure.
6 This is a manually maintained version used for the Watcom,
7 Borland and Microsoft Visual C++ compilers. It is a
8 standard part of the Python distribution.
11 The code specific to Windows should be wrapped around one of
12 the following #defines
14 MS_WIN64 - Code specific to the MS Win64 API
15 MS_WIN32 - Code specific to the MS Win32 (and Win64) API (obsolete, this covers all supported APIs)
16 MS_WINDOWS - Code specific to Windows, but all versions.
17 MS_WINCE - Code specific to Windows CE
18 Py_ENABLE_SHARED - Code if the Python core is built as a DLL.
20 Also note that neither "_M_IX86" or "_MSC_VER" should be used for
21 any purpose other than "Windows Intel x86 specific" and "Microsoft
22 compiler specific". Therefore, these should be very rare.
25 NOTE: The following symbols are deprecated:
26 NT, USE_DL_EXPORT, USE_DL_IMPORT, DL_EXPORT, DL_IMPORT
29 WIN32 is still required for the locale module.
37 /* Deprecated USE_DL_EXPORT macro - please use Py_BUILD_CORE */
39 # define Py_BUILD_CORE
40 #endif /* USE_DL_EXPORT */
42 /* Visual Studio 2005 introduces deprecation warnings for
43 "insecure" and POSIX functions. The insecure functions should
44 be replaced by *_s versions (according to Microsoft); the
45 POSIX functions by _* versions (which, according to Microsoft,
46 would be ISO C conforming). Neither renaming is feasible, so
47 we just silence the warnings. */
49 #ifndef _CRT_SECURE_NO_DEPRECATE
50 #define _CRT_SECURE_NO_DEPRECATE 1
52 #ifndef _CRT_NONSTDC_NO_DEPRECATE
53 #define _CRT_NONSTDC_NO_DEPRECATE 1
56 /* Windows CE does not have these */
59 #define HAVE_SYS_UTIME_H
73 #define DONT_HAVE_SIG_ALARM
74 #define DONT_HAVE_SIG_PAUSE
78 #define EXEC_PREFIX ""
80 #define MS_WIN32 /* only support win32 and greater. */
83 # define PYTHONPATH ".\\DLLs;.\\lib;.\\lib\\plat-win;.\\lib\\lib-tk"
91 /* CE6 doesn't have strdup() but _strdup(). Assume the same for earlier versions. */
94 # define strdup _strdup
98 /* Windows CE does not support environment variables */
99 #define getenv(v) (NULL)
100 #define environ (NULL)
103 /* Compiler specific defines */
105 /* ------------------------------------------------------------------------*/
106 /* Microsoft C defines _MSC_VER */
109 /* We want COMPILER to expand to a string containing _MSC_VER's *value*.
110 * This is horridly tricky, because the stringization operator only works
111 * on macro arguments, and doesn't evaluate macros passed *as* arguments.
112 * Attempts simpler than the following appear doomed to produce "_MSC_VER"
113 * literally in the string.
115 #define _Py_PASTE_VERSION(SUFFIX) \
116 ("[MSC v." _Py_STRINGIZE(_MSC_VER) " " SUFFIX "]")
117 /* e.g., this produces, after compile-time string catenation,
118 * ("[MSC v.1200 32 bit (Intel)]")
120 * _Py_STRINGIZE(_MSC_VER) expands to
121 * _Py_STRINGIZE1((_MSC_VER)) expands to
122 * _Py_STRINGIZE2(_MSC_VER) but as this call is the result of token-pasting
123 * it's scanned again for macros and so further expands to (under MSVC 6)
124 * _Py_STRINGIZE2(1200) which then expands to
127 #define _Py_STRINGIZE(X) _Py_STRINGIZE1((X))
128 #define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X
129 #define _Py_STRINGIZE2(X) #X
131 /* MSVC defines _WINxx to differentiate the windows platform types
133 Note that for compatibility reasons _WIN32 is defined on Win32
134 *and* on Win64. For the same reasons, in Python, MS_WIN32 is
135 defined on Win32 *and* Win64. Win32 only code must therefore be
137 #if defined(MS_WIN32) && !defined(MS_WIN64)
138 Some modules are disabled on Itanium processors, therefore we
139 have MS_WINI64 set for those targets, otherwise MS_WINX64
145 /* set the COMPILER */
148 #define COMPILER _Py_PASTE_VERSION("64 bit (Itanium)")
150 #elif defined(_M_X64) || defined(_M_AMD64)
151 #define COMPILER _Py_PASTE_VERSION("64 bit (AMD64)")
154 #define COMPILER _Py_PASTE_VERSION("64 bit (Unknown)")
156 #endif /* MS_WIN64 */
158 /* set the version macros for the windows headers */
160 /* 64 bit only runs on XP or greater */
161 #define Py_WINVER _WIN32_WINNT_WINXP
162 #define Py_NTDDI NTDDI_WINXP
164 /* Python 2.6+ requires Windows 2000 or greater */
165 #ifdef _WIN32_WINNT_WIN2K
166 #define Py_WINVER _WIN32_WINNT_WIN2K
168 #define Py_WINVER 0x0500
170 #define Py_NTDDI NTDDI_WIN2KSP4
173 /* We only set these values when building Python - we don't want to force
174 these values on extensions, as that will affect the prototypes and
175 structures exposed in the Windows headers. Even when building Python, we
176 allow a single source file to override this - they may need access to
177 structures etc so it can optionally use new Windows features if it
178 determines at runtime they are available.
180 #if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_MODULE)
181 #ifndef NTDDI_VERSION
182 #define NTDDI_VERSION Py_NTDDI
185 #define WINVER Py_WINVER
188 #define _WIN32_WINNT Py_WINVER
192 /* _W64 is not defined for VC6 or eVC4 */
197 /* Define like size_t, omitting the "unsigned" */
199 typedef __int64 ssize_t
;
201 typedef _W64
int ssize_t
;
203 #define HAVE_SSIZE_T 1
205 #if defined(MS_WIN32) && !defined(MS_WIN64)
207 #define COMPILER _Py_PASTE_VERSION("32 bit (Intel)")
209 #define COMPILER _Py_PASTE_VERSION("32 bit (Unknown)")
211 #endif /* MS_WIN32 && !MS_WIN64 */
216 #define Py_IS_NAN _isnan
217 #define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X))
218 #define Py_IS_FINITE(X) _finite(X)
219 #define copysign _copysign
222 #endif /* _MSC_VER */
224 /* define some ANSI types that are not defined in earlier Win headers */
225 #if defined(_MSC_VER) && _MSC_VER >= 1200
226 /* This file only exists in VC 6.0 or higher */
230 /* ------------------------------------------------------------------------*/
231 /* The Borland compiler defines __BORLANDC__ */
232 /* XXX These defines are likely incomplete, but should be easy to fix. */
234 #define COMPILER "[Borland]"
237 /* tested with BCC 5.5 (__BORLANDC__ >= 0x0550)
241 /* BCC55 seems to understand __declspec(dllimport), it is used in its
242 own header files (winnt.h, ...) - so we can do nothing and get the default*/
244 #undef HAVE_SYS_UTIME_H
246 #define HAVE_DIRENT_H
248 /* rename a few functions for the Borland compiler */
250 #define _chsize chsize
251 #define _setmode setmode
254 #error "Only Win32 and later are supported"
257 #endif /* BORLANDC */
259 /* ------------------------------------------------------------------------*/
260 /* egcs/gnu-win32 defines __GNUC__ and _WIN32 */
261 #if defined(__GNUC__) && defined(_WIN32)
262 /* XXX These defines are likely incomplete, but should be easy to fix.
263 They should be complete enough to build extension modules. */
264 /* Suggested by Rene Liebscher <R.Liebscher@gmx.de> to avoid a GCC 2.91.*
265 bug that requires structure imports. More recent versions of the
266 compiler don't exhibit this bug.
268 #if (__GNUC__==2) && (__GNUC_MINOR__<=91)
269 #warning "Please use an up-to-date version of gcc! (>2.91 recommended)"
272 #define COMPILER "[gcc]"
274 #define PY_LONG_LONG long long
275 #define PY_LLONG_MIN LLONG_MIN
276 #define PY_LLONG_MAX LLONG_MAX
277 #define PY_ULLONG_MAX ULLONG_MAX
280 /* ------------------------------------------------------------------------*/
281 /* lcc-win32 defines __LCC__ */
283 /* XXX These defines are likely incomplete, but should be easy to fix.
284 They should be complete enough to build extension modules. */
286 #define COMPILER "[lcc-win32]"
288 /* __declspec() is supported here too - do nothing to get the defaults */
292 /* ------------------------------------------------------------------------*/
293 /* End of compilers - finish up */
299 /* 64 bit ints are usually spelt __int64 unless compiler has overridden */
300 #define HAVE_LONG_LONG 1
302 # define PY_LONG_LONG __int64
303 # define PY_LLONG_MAX _I64_MAX
304 # define PY_LLONG_MIN _I64_MIN
305 # define PY_ULLONG_MAX _UI64_MAX
308 /* For Windows the Python core is in a DLL by default. Test
309 Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
310 #if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED)
311 # define Py_ENABLE_SHARED 1 /* standard symbol for shared library */
312 # define MS_COREDLL /* deprecated old symbol */
313 #endif /* !MS_NO_COREDLL && ... */
315 /* All windows compilers that use this header support __declspec */
316 #define HAVE_DECLSPEC_DLL
318 /* For an MSVC DLL, we can nominate the .lib files used by extensions */
320 # ifndef Py_BUILD_CORE /* not building the core - must be an ext */
321 # if defined(_MSC_VER)
322 /* So MSVC users need not specify the .lib file in
323 their Makefile (other compilers are generally
324 taken care of by distutils.) */
326 # pragma comment(lib,"python27_d.lib")
328 # pragma comment(lib,"python27.lib")
330 # endif /* _MSC_VER */
331 # endif /* Py_BUILD_CORE */
332 #endif /* MS_COREDLL */
334 #if defined(MS_WIN64)
335 /* maintain "win32" sys.platform for backward compatibility of Python code,
336 the Win64 API should be close enough to the Win32 API to make this
338 # define PLATFORM "win32"
339 # define SIZEOF_VOID_P 8
340 # define SIZEOF_TIME_T 8
341 # define SIZEOF_OFF_T 4
342 # define SIZEOF_FPOS_T 8
343 # define SIZEOF_HKEY 8
344 # define SIZEOF_SIZE_T 8
345 /* configure.in defines HAVE_LARGEFILE_SUPPORT iff HAVE_LONG_LONG,
346 sizeof(off_t) > sizeof(long), and sizeof(PY_LONG_LONG) >= sizeof(off_t).
347 On Win64 the second condition is not true, but if fpos_t replaces off_t
348 then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64
349 should define this. */
350 # define HAVE_LARGEFILE_SUPPORT
351 #elif defined(MS_WIN32)
352 # define PLATFORM "win32"
353 # define HAVE_LARGEFILE_SUPPORT
354 # define SIZEOF_VOID_P 4
355 # define SIZEOF_OFF_T 4
356 # define SIZEOF_FPOS_T 8
357 # define SIZEOF_HKEY 4
358 # define SIZEOF_SIZE_T 4
359 /* MS VS2005 changes time_t to an 64-bit type on all platforms */
360 # if defined(_MSC_VER) && _MSC_VER >= 1400
361 # define SIZEOF_TIME_T 8
363 # define SIZEOF_TIME_T 4
374 #define SIZEOF_SHORT 2
376 #define SIZEOF_LONG 4
377 #define SIZEOF_LONG_LONG 8
378 #define SIZEOF_DOUBLE 8
379 #define SIZEOF_FLOAT 4
381 /* VC 7.1 has them and VC 6.0 does not. VC 6.0 has a version number of 1200.
382 Microsoft eMbedded Visual C++ 4.0 has a version number of 1201 and doesn't
384 If some compiler does not provide them, modify the #if appropriately. */
385 #if defined(_MSC_VER)
387 #define HAVE_UINTPTR_T 1
388 #define HAVE_INTPTR_T 1
390 /* VC6, VS 2002 and eVC4 don't support the C99 LL suffix for 64-bit integer literals */
391 #define Py_LL(x) x##I64
392 #endif /* _MSC_VER > 1200 */
393 #endif /* _MSC_VER */
397 /* define signed and unsigned exact-width 32-bit and 64-bit types, used in the
398 implementation of Python long integers. */
401 #define HAVE_UINT32_T 1
402 #define PY_UINT32_T unsigned int
403 #elif SIZEOF_LONG == 4
404 #define HAVE_UINT32_T 1
405 #define PY_UINT32_T unsigned long
410 #if SIZEOF_LONG_LONG == 8
411 #define HAVE_UINT64_T 1
412 #define PY_UINT64_T unsigned PY_LONG_LONG
418 #define HAVE_INT32_T 1
419 #define PY_INT32_T int
420 #elif SIZEOF_LONG == 4
421 #define HAVE_INT32_T 1
422 #define PY_INT32_T long
427 #if SIZEOF_LONG_LONG == 8
428 #define HAVE_INT64_T 1
429 #define PY_INT64_T PY_LONG_LONG
433 /* Fairly standard from here! */
435 /* Define to 1 if you have the `copysign' function. */
436 #define HAVE_COPYSIGN 1
438 /* Define to 1 if you have the `isinf' macro. */
439 #define HAVE_DECL_ISINF 1
441 /* Define to 1 if you have the `isnan' function. */
442 #define HAVE_DECL_ISNAN 1
444 /* Define if on AIX 3.
445 System headers sometimes define this.
446 We just want to avoid a redefinition error message. */
448 /* #undef _ALL_SOURCE */
451 /* Define to empty if the keyword does not work. */
454 /* Define to 1 if you have the <conio.h> header file. */
456 #define HAVE_CONIO_H 1
459 /* Define to 1 if you have the <direct.h> header file. */
461 #define HAVE_DIRECT_H 1
464 /* Define if you have dirent.h. */
465 /* #define DIRENT 1 */
467 /* Define to the type of elements in the array set by `getgroups'.
468 Usually this is either `int' or `gid_t'. */
469 /* #undef GETGROUPS_T */
471 /* Define to `int' if <sys/types.h> doesn't define. */
474 /* Define if your struct tm has tm_zone. */
475 /* #undef HAVE_TM_ZONE */
477 /* Define if you don't have tm_zone but do have the external array
481 /* Define to `int' if <sys/types.h> doesn't define. */
484 /* Define if you don't have dirent.h, but have ndir.h. */
487 /* Define to `long' if <sys/types.h> doesn't define. */
490 /* Define to `int' if <sys/types.h> doesn't define. */
493 /* Define if the system does not provide POSIX.1 features except
494 with this defined. */
495 /* #undef _POSIX_1_SOURCE */
497 /* Define if you need to in order for stat and other things to work. */
498 /* #undef _POSIX_SOURCE */
500 /* Define as the return type of signal handlers (int or void). */
501 #define RETSIGTYPE void
503 /* Define to `unsigned' if <sys/types.h> doesn't define. */
506 /* Define if you have the ANSI C header files. */
507 #define STDC_HEADERS 1
509 /* Define if you don't have dirent.h, but have sys/dir.h. */
512 /* Define if you don't have dirent.h, but have sys/ndir.h. */
515 /* Define if you can safely include both <sys/time.h> and <time.h>. */
516 /* #undef TIME_WITH_SYS_TIME */
518 /* Define if your <sys/time.h> declares struct tm. */
519 /* #define TM_IN_SYS_TIME 1 */
521 /* Define to `int' if <sys/types.h> doesn't define. */
524 /* Define if the closedir function returns void instead of int. */
525 /* #undef VOID_CLOSEDIR */
527 /* Define if getpgrp() must be called as getpgrp(0)
528 and (consequently) setpgrp() as setpgrp(0, 0). */
529 /* #undef GETPGRP_HAVE_ARGS */
531 /* Define this if your time.h defines altzone */
532 /* #define HAVE_ALTZONE */
534 /* Define if you have the putenv function. */
539 /* Define if your compiler supports function prototypes */
540 #define HAVE_PROTOTYPES
542 /* Define if you can safely include both <sys/select.h> and <sys/time.h>
543 (which you can't on SCO ODT 3.0). */
544 /* #undef SYS_SELECT_WITH_SYS_TIME */
546 /* Define if you want documentation strings in extension modules */
547 #define WITH_DOC_STRINGS 1
549 /* Define if you want to compile in rudimentary thread support */
550 /* #undef WITH_THREAD */
552 /* Define if you want to use the GNU readline library */
553 /* #define WITH_READLINE 1 */
555 /* Define if you want to have a Unicode type. */
556 #define Py_USING_UNICODE
558 /* Define as the size of the unicode type. */
559 /* This is enough for unicodeobject.h to do the "right thing" on Windows. */
560 #define Py_UNICODE_SIZE 2
562 /* Use Python's own small-block memory-allocator. */
563 #define WITH_PYMALLOC 1
565 /* Define if you have clock. */
566 /* #define HAVE_CLOCK */
568 /* Define when any dynamic module loading is enabled */
569 #define HAVE_DYNAMIC_LOADING
571 /* Define if you have ftime. */
576 /* Define if you have getpeername. */
577 #define HAVE_GETPEERNAME
579 /* Define if you have getpgrp. */
580 /* #undef HAVE_GETPGRP */
582 /* Define if you have getpid. */
587 /* Define if you have gettimeofday. */
588 /* #undef HAVE_GETTIMEOFDAY */
590 /* Define if you have getwd. */
591 /* #undef HAVE_GETWD */
593 /* Define if you have lstat. */
594 /* #undef HAVE_LSTAT */
596 /* Define if you have the mktime function. */
599 /* Define if you have nice. */
600 /* #undef HAVE_NICE */
602 /* Define if you have readlink. */
603 /* #undef HAVE_READLINK */
605 /* Define if you have select. */
606 /* #undef HAVE_SELECT */
608 /* Define if you have setpgid. */
609 /* #undef HAVE_SETPGID */
611 /* Define if you have setpgrp. */
612 /* #undef HAVE_SETPGRP */
614 /* Define if you have setsid. */
615 /* #undef HAVE_SETSID */
617 /* Define if you have setvbuf. */
620 /* Define if you have siginterrupt. */
621 /* #undef HAVE_SIGINTERRUPT */
623 /* Define if you have symlink. */
624 /* #undef HAVE_SYMLINK */
626 /* Define if you have tcgetpgrp. */
627 /* #undef HAVE_TCGETPGRP */
629 /* Define if you have tcsetpgrp. */
630 /* #undef HAVE_TCSETPGRP */
632 /* Define if you have times. */
633 /* #undef HAVE_TIMES */
635 /* Define if you have uname. */
636 /* #undef HAVE_UNAME */
638 /* Define if you have waitpid. */
639 /* #undef HAVE_WAITPID */
641 /* Define to 1 if you have the `wcscoll' function. */
643 #define HAVE_WCSCOLL 1
646 /* Define if you have the <dlfcn.h> header file. */
647 /* #undef HAVE_DLFCN_H */
649 /* Define to 1 if you have the <errno.h> header file. */
651 #define HAVE_ERRNO_H 1
654 /* Define if you have the <fcntl.h> header file. */
656 #define HAVE_FCNTL_H 1
659 /* Define to 1 if you have the <process.h> header file. */
661 #define HAVE_PROCESS_H 1
664 /* Define to 1 if you have the <signal.h> header file. */
666 #define HAVE_SIGNAL_H 1
669 /* Define if you have the <stdarg.h> prototypes. */
670 #define HAVE_STDARG_PROTOTYPES
672 /* Define if you have the <stddef.h> header file. */
673 #define HAVE_STDDEF_H 1
675 /* Define if you have the <sys/audioio.h> header file. */
676 /* #undef HAVE_SYS_AUDIOIO_H */
678 /* Define if you have the <sys/param.h> header file. */
679 /* #define HAVE_SYS_PARAM_H 1 */
681 /* Define if you have the <sys/select.h> header file. */
682 /* #define HAVE_SYS_SELECT_H 1 */
684 /* Define to 1 if you have the <sys/stat.h> header file. */
686 #define HAVE_SYS_STAT_H 1
689 /* Define if you have the <sys/time.h> header file. */
690 /* #define HAVE_SYS_TIME_H 1 */
692 /* Define if you have the <sys/times.h> header file. */
693 /* #define HAVE_SYS_TIMES_H 1 */
695 /* Define to 1 if you have the <sys/types.h> header file. */
697 #define HAVE_SYS_TYPES_H 1
700 /* Define if you have the <sys/un.h> header file. */
701 /* #define HAVE_SYS_UN_H 1 */
703 /* Define if you have the <sys/utime.h> header file. */
704 /* #define HAVE_SYS_UTIME_H 1 */
706 /* Define if you have the <sys/utsname.h> header file. */
707 /* #define HAVE_SYS_UTSNAME_H 1 */
709 /* Define if you have the <thread.h> header file. */
710 /* #undef HAVE_THREAD_H */
712 /* Define if you have the <unistd.h> header file. */
713 /* #define HAVE_UNISTD_H 1 */
715 /* Define if you have the <utime.h> header file. */
716 /* #define HAVE_UTIME_H 1 */
718 /* Define if the compiler provides a wchar.h header file. */
719 #define HAVE_WCHAR_H 1
721 /* Define if you have the dl library (-ldl). */
722 /* #undef HAVE_LIBDL */
724 /* Define if you have the mpc library (-lmpc). */
725 /* #undef HAVE_LIBMPC */
727 /* Define if you have the nsl library (-lnsl). */
728 #define HAVE_LIBNSL 1
730 /* Define if you have the seq library (-lseq). */
731 /* #undef HAVE_LIBSEQ */
733 /* Define if you have the socket library (-lsocket). */
734 #define HAVE_LIBSOCKET 1
736 /* Define if you have the sun library (-lsun). */
737 /* #undef HAVE_LIBSUN */
739 /* Define if you have the termcap library (-ltermcap). */
740 /* #undef HAVE_LIBTERMCAP */
742 /* Define if you have the termlib library (-ltermlib). */
743 /* #undef HAVE_LIBTERMLIB */
745 /* Define if you have the thread library (-lthread). */
746 /* #undef HAVE_LIBTHREAD */
748 /* WinSock does not use a bitmask in select, and uses
749 socket handles greater than FD_SETSIZE */
750 #define Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE
752 /* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
753 least significant byte first */
754 #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1
756 #endif /* !Py_CONFIG_H */