[Python-checkins] python/dist/src/Include pyport.h,2.51,2.52 import.h,2.27,2.28

mhammond@users.sourceforge.net mhammond@users.sourceforge.net
Thu, 18 Jul 2002 23:55:43 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv15103/Include

Modified Files:
	pyport.h import.h 
Log Message:
Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.



Index: pyport.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v
retrieving revision 2.51
retrieving revision 2.52
diff -C2 -d -r2.51 -r2.52
*** pyport.h	3 Jul 2002 03:31:20 -0000	2.51
--- pyport.h	19 Jul 2002 06:55:40 -0000	2.52
***************
*** 380,396 ****
  #endif
  
! #ifndef __CYGWIN__
! #ifndef DL_IMPORT       /* declarations for DLL import */
! #define DL_IMPORT(RTYPE) RTYPE
  #endif
! #else /* __CYGWIN__ */
! #ifdef USE_DL_IMPORT
! #define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
! #define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
! #else /* !USE_DL_IMPORT */
! #define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
! #define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
! #endif /* USE_DL_IMPORT */
! #endif /* __CYGWIN__ */
  
  /* If the fd manipulation macros aren't defined,
--- 380,459 ----
  #endif
  
! /* Declarations for symbol visibility.
! 
!   PyAPI_FUNC(type): Declares a public Python API function and return type
!   PyAPI_DATA(type): Declares public Python data and its type 
!   PyMODINIT_FUNC:   A Python module init function.  If these functions are
!                     inside the Python core, they are private to the core.  
!                     If in an extension module, it may be declared with 
!                     external linkage depending on the platform.
! 
!   As a number of platforms support/require "__declspec(dllimport/dllexport)",
!   we support a HAVE_DECLSPEC_DLL macro to save duplication.
! */
! 
! /* 
! All windows ports, except cygwin, are handled in PC/pyconfig.h
! BeOS is only other autoconf platform requiring special linkage handling
! and both these use __declspec()
! */
! #if defined(__CYGWIN__) || defined(__BEOS__)
! #	define HAVE_DECLSPEC_DLL
  #endif
! 
! #if defined(Py_ENABLE_SHARED) /* only get special linkage if built as shared */
! #	if defined(HAVE_DECLSPEC_DLL)
! #		ifdef Py_BUILD_CORE
! #			define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE
! #			define PyAPI_DATA(RTYPE) __declspec(dllexport) RTYPE
! 			/* module init functions inside the core need no external linkage */
! #			define PyMODINIT_FUNC void
! #		else /* Py_BUILD_CORE */
! 			/* Building an extension module, or an embedded situation */
! 			/* public Python functions and data are imported */
! #			define PyAPI_FUNC(RTYPE) __declspec(dllimport) RTYPE
! #			define PyAPI_DATA(RTYPE) __declspec(dllimport) RTYPE
! 			/* module init functions outside the core must be exported */
! #			if defined(__cplusplus)
! #				define PyMODINIT_FUNC extern "C" __declspec(dllexport) void
! #			else /* __cplusplus */
! #				define PyMODINIT_FUNC __declspec(dllexport) void
! #			endif /* __cplusplus */
! #		endif /* Py_BUILD_CORE */
! #	endif /* HAVE_DECLSPEC */
! #endif /* Py_ENABLE_SHARED */
! 
! /* If no external linkage macros defined by now, create defaults */
! #ifndef PyAPI_FUNC
! #	define PyAPI_FUNC(RTYPE) RTYPE
! #endif
! #ifndef PyAPI_DATA
! #	define PyAPI_DATA(RTYPE) RTYPE
! #endif
! #ifndef PyMODINIT_FUNC
! #	if defined(__cplusplus)
! #		define PyMODINIT_FUNC extern "C" void
! #	else /* __cplusplus */
! #		define PyMODINIT_FUNC void
! #	endif /* __cplusplus */
! #endif
! 
! /* Deprecated DL_IMPORT and DL_EXPORT macros */
! #if defined(Py_ENABLE_SHARED) && defined (HAVE_DECLSPEC_DLL)
! #	if defined(Py_BUILD_CORE)
! #		define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
! #		define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
! #	else
! #		define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
! #		define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
! #	endif
! #endif
! #ifndef DL_EXPORT
! #	define DL_EXPORT(RTYPE) RTYPE
! #endif
! #ifndef DL_IMPORT
! #	define DL_IMPORT(RTYPE) RTYPE
! #endif
! /* End of deprecated DL_* macros */
  
  /* If the fd manipulation macros aren't defined,
***************
*** 457,469 ****
   */
  #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
- #endif
- 
- /*
-  * Rename some functions for the Borland compiler
-  */
- #ifdef __BORLANDC__
- #  include <io.h>
- #  define _chsize chsize
- #  define _setmode setmode
  #endif
  
--- 520,523 ----

Index: import.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/import.h,v
retrieving revision 2.27
retrieving revision 2.28
diff -C2 -d -r2.27 -r2.28
*** import.h	1 Sep 2000 23:29:26 -0000	2.27
--- import.h	19 Jul 2002 06:55:41 -0000	2.28
***************
*** 8,27 ****
  #endif
  
! DL_IMPORT(long) PyImport_GetMagicNumber(void);
! DL_IMPORT(PyObject *) PyImport_ExecCodeModule(char *name, PyObject *co);
! DL_IMPORT(PyObject *) PyImport_ExecCodeModuleEx(
  	char *name, PyObject *co, char *pathname);
! DL_IMPORT(PyObject *) PyImport_GetModuleDict(void);
! DL_IMPORT(PyObject *) PyImport_AddModule(char *name);
! DL_IMPORT(PyObject *) PyImport_ImportModule(char *name);
! DL_IMPORT(PyObject *) PyImport_ImportModuleEx(
  	char *name, PyObject *globals, PyObject *locals, PyObject *fromlist);
! DL_IMPORT(PyObject *) PyImport_Import(PyObject *name);
! DL_IMPORT(PyObject *) PyImport_ReloadModule(PyObject *m);
! DL_IMPORT(void) PyImport_Cleanup(void);
! DL_IMPORT(int) PyImport_ImportFrozenModule(char *);
  
! extern DL_IMPORT(PyObject *)_PyImport_FindExtension(char *, char *);
! extern DL_IMPORT(PyObject *)_PyImport_FixupExtension(char *, char *);
  
  struct _inittab {
--- 8,27 ----
  #endif
  
! PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
! PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(char *name, PyObject *co);
! PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx(
  	char *name, PyObject *co, char *pathname);
! PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void);
! PyAPI_FUNC(PyObject *) PyImport_AddModule(char *name);
! PyAPI_FUNC(PyObject *) PyImport_ImportModule(char *name);
! PyAPI_FUNC(PyObject *) PyImport_ImportModuleEx(
  	char *name, PyObject *globals, PyObject *locals, PyObject *fromlist);
! PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name);
! PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m);
! PyAPI_FUNC(void) PyImport_Cleanup(void);
! PyAPI_FUNC(int) PyImport_ImportFrozenModule(char *);
  
! extern PyAPI_FUNC(PyObject *)_PyImport_FindExtension(char *, char *);
! extern PyAPI_FUNC(PyObject *)_PyImport_FixupExtension(char *, char *);
  
  struct _inittab {
***************
*** 30,37 ****
  };
  
! extern DL_IMPORT(struct _inittab *) PyImport_Inittab;
  
! extern DL_IMPORT(int) PyImport_AppendInittab(char *name, void (*initfunc)(void));
! extern DL_IMPORT(int) PyImport_ExtendInittab(struct _inittab *newtab);
  
  struct _frozen {
--- 30,37 ----
  };
  
! extern PyAPI_DATA(struct _inittab *) PyImport_Inittab;
  
! extern PyAPI_FUNC(int) PyImport_AppendInittab(char *name, void (*initfunc)(void));
! extern PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
  
  struct _frozen {
***************
*** 44,48 ****
     collection of frozen modules: */
  
! extern DL_IMPORT(struct _frozen *) PyImport_FrozenModules;
  
  #ifdef __cplusplus
--- 44,48 ----
     collection of frozen modules: */
  
! extern PyAPI_DATA(struct _frozen *) PyImport_FrozenModules;
  
  #ifdef __cplusplus