[Python-checkins] CVS: python/dist/src/PC config.h,1.44,1.45

Mark Hammond python-dev@python.org
Tue, 15 Aug 2000 15:34:02 -0700


Update of /cvsroot/python/python/dist/src/PC
In directory slayer.i.sourceforge.net:/tmp/cvs-serv1246

Modified Files:
	config.h 
Log Message:
From Rene Liebscher:
This patch makes it possible to use gnu-win32 and lcc-win32 
(http://www.cs.virginia.edu/~lcc-win32/) compilers to build 
extension modules. It adds compiler specific sections to
PC/config.h .
It also extends the Borland compiler section. This has then two parts,
one for Win32 and the other one for the rest. The Win32 part 
should be almost complete.

*** This patch is not intended to make it possible to compile
     Python with these compilers, it is intended to be able to
     use these compilers to build extension modules. ****


Index: config.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/config.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -r1.44 -r1.45
*** config.h	2000/08/07 20:16:28	1.44
--- config.h	2000/08/15 22:33:59	1.45
***************
*** 27,37 ****
  */
  
- /* Suggested by Rene Liebscher <R.Liebscher@gmx.de> to avoid a GCC 2.91.*
-    bug that requires structure imports.  More recent versions of the
-    compiler don't exhibit this bug.
- */
- #if (__GNUC__==2) && (__GNUC_MINOR__<=91)
- #warning "Please use an up-to-date version of gcc! (>2.91 recommended)"
- #endif
  
  /*
--- 27,30 ----
***************
*** 231,242 ****
  #ifdef __BORLANDC__
  #define COMPILER "[Borland]"
- #define PYTHONPATH ".;.\\lib;.\\lib\\plat-win;.\\lib\\dos-8x3"
- #define IMPORT_8x3_NAMES
  #define HAVE_CLOCK
  #define HAVE_STRFTIME
  #ifdef USE_DL_IMPORT
  #define DL_IMPORT(RTYPE)  RTYPE __import
  #endif
  #endif /* BORLANDC */
  
  /* End of compilers - finish up */
--- 224,379 ----
  #ifdef __BORLANDC__
  #define COMPILER "[Borland]"
  #define HAVE_CLOCK
  #define HAVE_STRFTIME
+ 
+ #ifdef _WIN32
+ 
+ /* tested with BCC 5.5 (__BORLANDC__ >= 0x0550)
+  */
+ #define NT	/* NT is obsolete - please use MS_WIN32 instead */
+ #define MS_WIN32
+ #define MS_WINDOWS
+ 
+ /* For NT the Python core is in a DLL by default.  Test the
+ standard macro MS_COREDLL to find out.  If you have an exception
+ you must define MS_NO_COREDLL (do not test this macro) */
+ #ifndef MS_NO_COREDLL
+ #define MS_COREDLL	/* Python core is in a DLL */
+ #ifndef USE_DL_EXPORT
+ #define USE_DL_IMPORT
+ #endif /* !USE_DL_EXPORT */
+ #endif /* !MS_NO_COREDLL */
+ 
+ #define PYTHONPATH ".\\DLLs;.\\lib;.\\lib\\plat-win;.\\lib\\lib-tk"
+ typedef int pid_t;
+ #define WORD_BIT 32
+ #include <stdio.h>
+ #define HAVE_STRERROR
+ #define NT_THREADS
+ #define WITH_THREAD
+ #ifndef NETSCAPE_PI
+ #define USE_SOCKET
+ #endif
+ /* BCC55 seems to understand __declspec(dllimport), it is used in its
+    own header files (winnt.h, ...) */
+ #ifdef USE_DL_IMPORT
+ #define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
+ #endif
+ #ifdef USE_DL_EXPORT
+ #define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
+ #define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
+ #endif
+ 
+ #define HAVE_LONG_LONG 1
+ #define LONG_LONG __int64
+ 
+ #else /* !_WIN32 */
+ /* XXX These defines are likely incomplete, but should be easy to fix. */
+ 
+ #define PYTHONPATH ".;.\\lib;.\\lib\\plat-win;.\\lib\\dos-8x3"
+ #define IMPORT_8x3_NAMES
  #ifdef USE_DL_IMPORT
  #define DL_IMPORT(RTYPE)  RTYPE __import
  #endif
+ 
+ #endif /* !_WIN32 */
+ 
  #endif /* BORLANDC */
+ 
+ /* egcs/gnu-win32 defines __GNUC__ and _WIN32 */
+ #if defined(__GNUC__) && defined(_WIN32)
+ /* XXX These defines are likely incomplete, but should be easy to fix. 
+    They should be complete enough to build extension modules. */
+ /* Suggested by Rene Liebscher <R.Liebscher@gmx.de> to avoid a GCC 2.91.*
+    bug that requires structure imports.  More recent versions of the
+    compiler don't exhibit this bug.
+ */
+ #if (__GNUC__==2) && (__GNUC_MINOR__<=91)
+ #warning "Please use an up-to-date version of gcc! (>2.91 recommended)"
+ #endif
+ 
+ #define NT	/* NT is obsolete - please use MS_WIN32 instead */
+ #define MS_WIN32
+ #define MS_WINDOWS
+ 
+ /* For NT the Python core is in a DLL by default.  Test the
+ standard macro MS_COREDLL to find out.  If you have an exception
+ you must define MS_NO_COREDLL (do not test this macro) */
+ #ifndef MS_NO_COREDLL
+ #define MS_COREDLL	/* Python core is in a DLL */
+ #ifndef USE_DL_EXPORT
+ #define USE_DL_IMPORT
+ #endif /* !USE_DL_EXPORT */
+ #endif /* !MS_NO_COREDLL */
+ 
+ #define COMPILER "[gcc]"
+ #define PYTHONPATH ".\\DLLs;.\\lib;.\\lib\\plat-win;.\\lib\\lib-tk"
+ #define WORD_BIT 32
+ #define hypot _hypot
+ #include <stdio.h>
+ #define HAVE_CLOCK
+ #define HAVE_STRFTIME
+ #define HAVE_STRERROR
+ #define NT_THREADS
+ #define WITH_THREAD
+ #ifndef NETSCAPE_PI
+ #define USE_SOCKET
+ #endif
+ #ifdef USE_DL_IMPORT
+ #define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
+ #endif
+ #ifdef USE_DL_EXPORT
+ #define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
+ #define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
+ #endif
+ 
+ #define HAVE_LONG_LONG 1
+ #define LONG_LONG long long 
+ #endif /* GNUC */
+ 
+ /* lcc-win32 defines __LCC__ */
+ 
+ #if defined(__LCC__)
+ /* XXX These defines are likely incomplete, but should be easy to fix. 
+    They should be complete enough to build extension modules. */
+ 
+ #define NT	/* NT is obsolete - please use MS_WIN32 instead */
+ #define MS_WIN32
+ #define MS_WINDOWS
+ 
+ /* For NT the Python core is in a DLL by default.  Test the
+ standard macro MS_COREDLL to find out.  If you have an exception
+ you must define MS_NO_COREDLL (do not test this macro) */
+ #ifndef MS_NO_COREDLL
+ #define MS_COREDLL	/* Python core is in a DLL */
+ #ifndef USE_DL_EXPORT
+ #define USE_DL_IMPORT
+ #endif /* !USE_DL_EXPORT */
+ #endif /* !MS_NO_COREDLL */
+ 
+ #define COMPILER "[lcc-win32]"
+ #define PYTHONPATH ".\\DLLs;.\\lib;.\\lib\\plat-win;.\\lib\\lib-tk"
+ typedef int pid_t;
+ #define WORD_BIT 32
+ #include <stdio.h>
+ #define HAVE_CLOCK
+ #define HAVE_STRFTIME
+ #define HAVE_STRERROR
+ #define NT_THREADS
+ #define WITH_THREAD
+ #ifndef NETSCAPE_PI
+ #define USE_SOCKET
+ #endif
+ #ifdef USE_DL_IMPORT
+ #define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
+ #endif
+ #ifdef USE_DL_EXPORT
+ #define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
+ #define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
+ #endif
+ 
+ #define HAVE_LONG_LONG 1
+ #define LONG_LONG __int64
+ #endif /* LCC */
  
  /* End of compilers - finish up */