[Patches] Extension building on Win32 using Gnu C

Rene Liebscher R.Liebscher@gmx.de
Fri, 23 Jun 2000 17:38:33 +0200


Fred L. Drake, Jr. wrote:
> 
> Daniel Berlin writes:
>  > People who are concerned about stability tend to stay one major
>  > release behind, mainly because before EGCS became the official GCC, major
>  > releases often had very annoying bugs.
> 
>   Sounds like this is safe to accept; I'll check it in momentarily.
>   Thanks!
> 
I would use a #warning instead of an #error. It is possible to use
gcc2.91.*
and build perfect working extensions as long you use C and not C++. You
get some
warnings, but this is not a big problem. So we shouldn't force users
to update their compilers if they only use C. But we should give
them a hint where problems could come from. If they use C++,
the last what they see is this warning text before the compiler
crashes.("Almost the same behaviour as using an #error." OK, not
really.)
So there is no reason to be too restrictive and using
an #error.

But if you checked in these lines, you could also check in
the rest of the patch. (or what now is remaining from my first
submission) Without these lines in config.h GNU C won't work.

----------------------------------------------------------------
/* egcs/gnu-win32 defines __GNUC__ and _WIN32 */

#if defined(__GNUC__) && defined(_WIN32)
#define NT    /* NT is obsolete - please use MS_WIN32 instead */
#define MS_WIN32
#define MS_WINDOWS
#define HAVE_CLOCK
#define HAVE_STRFTIME
#define HAVE_STRERROR
#define NT_THREADS
#define WITH_THREAD
#define WORD_BIT 32
#define HAVE_LONG_LONG 1
#define LONG_LONG long long
#define PYTHONPATH ".\\DLLs;.\\lib;.\\lib\\plat-win;.\\lib\\lib-tk"
 
#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 */

#ifdef USE_DL_IMPORT
#define DL_IMPORT(sym) __declspec(dllimport) sym
#endif /* USE_DL_IMPORT */
#endif /* (defined(__GNUC__) && defined(_WIN32)) */
--------------------------------------------------------------

kind regards

Rene Liebscher