diff --git a/Include/accessobject.h b/Include/accessobject.h index fd8c2e910e3..56193087b8a 100644 --- a/Include/accessobject.h +++ b/Include/accessobject.h @@ -46,7 +46,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define AC_R_PUBLIC 0004 #define AC_W_PUBLIC 0002 -extern typeobject Accesstype; +extern DL_IMPORT typeobject Accesstype; #define is_accessobject(v) ((v)->ob_type == &Accesstype) @@ -58,7 +58,7 @@ void setaccessowner PROTO((object *, object *)); object *cloneaccessobject PROTO((object *)); int hasaccessvalue PROTO((object *)); -extern typeobject Anynumbertype, Anysequencetype, Anymappingtype; +extern DL_IMPORT typeobject Anynumbertype, Anysequencetype, Anymappingtype; #ifdef __cplusplus } diff --git a/Include/allobjects.h b/Include/allobjects.h index 2b361c1afd6..3d555d00e93 100644 --- a/Include/allobjects.h +++ b/Include/allobjects.h @@ -30,6 +30,19 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* "allobjects.c" -- Source for precompiled header "allobjects.h" */ +/* Some systems (well, NT anyway!) require special declarations for + data items imported from dynamic modules. Note that this defn is + only turned on for the modules built as DL modules, not for python + itself. +*/ +#define DL_IMPORT /* Save lots of #else/#if's */ +#ifdef USE_DL_IMPORT +#ifdef NT +#undef DL_IMPORT +#define DL_IMPORT __declspec(dllimport) +#endif /* NT */ +#endif /* USE_DL_IMPORT */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/Include/classobject.h b/Include/classobject.h index 6b1b85b44ee..f6193458509 100644 --- a/Include/classobject.h +++ b/Include/classobject.h @@ -57,7 +57,7 @@ typedef struct { #endif } instanceobject; -extern typeobject Classtype, Instancetype, Instancemethodtype; +extern DL_IMPORT typeobject Classtype, Instancetype, Instancemethodtype; #define is_classobject(op) ((op)->ob_type == &Classtype) #define is_instanceobject(op) ((op)->ob_type == &Instancetype) diff --git a/Include/compile.h b/Include/compile.h index 4526523df34..6c782da9a41 100644 --- a/Include/compile.h +++ b/Include/compile.h @@ -47,7 +47,7 @@ typedef struct { object *co_name; /* string */ } codeobject; -extern typeobject Codetype; +extern DL_IMPORT typeobject Codetype; #define is_codeobject(op) ((op)->ob_type == &Codetype) diff --git a/Include/errors.h b/Include/errors.h index 050ff192f26..33c7806ac80 100755 --- a/Include/errors.h +++ b/Include/errors.h @@ -39,25 +39,25 @@ void err_clear PROTO((void)); /* Predefined exceptions */ -extern object *AccessError; -extern object *AttributeError; -extern object *ConflictError; -extern object *EOFError; -extern object *IOError; -extern object *ImportError; -extern object *IndexError; -extern object *KeyError; -extern object *KeyboardInterrupt; -extern object *MemoryError; -extern object *NameError; -extern object *OverflowError; -extern object *RuntimeError; -extern object *SyntaxError; -extern object *SystemError; -extern object *SystemExit; -extern object *TypeError; -extern object *ValueError; -extern object *ZeroDivisionError; +extern DL_IMPORT object *AccessError; +extern DL_IMPORT object *AttributeError; +extern DL_IMPORT object *ConflictError; +extern DL_IMPORT object *EOFError; +extern DL_IMPORT object *IOError; +extern DL_IMPORT object *ImportError; +extern DL_IMPORT object *IndexError; +extern DL_IMPORT object *KeyError; +extern DL_IMPORT object *KeyboardInterrupt; +extern DL_IMPORT object *MemoryError; +extern DL_IMPORT object *NameError; +extern DL_IMPORT object *OverflowError; +extern DL_IMPORT object *RuntimeError; +extern DL_IMPORT object *SyntaxError; +extern DL_IMPORT object *SystemError; +extern DL_IMPORT object *SystemExit; +extern DL_IMPORT object *TypeError; +extern DL_IMPORT object *ValueError; +extern DL_IMPORT object *ZeroDivisionError; /* Convenience functions */ diff --git a/Include/fileobject.h b/Include/fileobject.h index c52a6aa6fb2..7cdd63a0678 100644 --- a/Include/fileobject.h +++ b/Include/fileobject.h @@ -30,7 +30,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* File object interface */ -extern typeobject Filetype; +extern DL_IMPORT typeobject Filetype; #define is_fileobject(op) ((op)->ob_type == &Filetype) diff --git a/Include/floatobject.h b/Include/floatobject.h index 1d0484fd181..f6999bd236d 100644 --- a/Include/floatobject.h +++ b/Include/floatobject.h @@ -39,7 +39,7 @@ typedef struct { double ob_fval; } floatobject; -extern typeobject Floattype; +extern DL_IMPORT typeobject Floattype; #define is_floatobject(op) ((op)->ob_type == &Floattype) diff --git a/Include/frameobject.h b/Include/frameobject.h index 24588811f90..d9b375a1a84 100644 --- a/Include/frameobject.h +++ b/Include/frameobject.h @@ -58,7 +58,7 @@ typedef struct _frame { /* Standard object interface */ -extern typeobject Frametype; +extern DL_IMPORT typeobject Frametype; #define is_frameobject(op) ((op)->ob_type == &Frametype) diff --git a/Include/funcobject.h b/Include/funcobject.h index 84b0dcf34bb..cb36518db50 100644 --- a/Include/funcobject.h +++ b/Include/funcobject.h @@ -39,7 +39,7 @@ typedef struct { object *func_argdefs; } funcobject; -extern typeobject Functype; +extern DL_IMPORT typeobject Functype; #define is_funcobject(op) ((op)->ob_type == &Functype) diff --git a/Include/intobject.h b/Include/intobject.h index 2ede41e2773..28471b54ed6 100644 --- a/Include/intobject.h +++ b/Include/intobject.h @@ -50,7 +50,7 @@ typedef struct { long ob_ival; } intobject; -extern typeobject Inttype; +extern DL_IMPORT typeobject Inttype; #define is_intobject(op) ((op)->ob_type == &Inttype) @@ -69,7 +69,7 @@ Hope these macros don't conflict with other people's. Don't forget to apply INCREF() when returning True or False!!! */ -extern intobject FalseObject, TrueObject; /* Don't use these directly */ +extern DL_IMPORT intobject FalseObject, TrueObject; /* Don't use these directly */ #define False ((object *) &FalseObject) #define True ((object *) &TrueObject) diff --git a/Include/listobject.h b/Include/listobject.h index 610096bba83..212e3ce96ee 100644 --- a/Include/listobject.h +++ b/Include/listobject.h @@ -49,7 +49,7 @@ typedef struct { object **ob_item; } listobject; -extern typeobject Listtype; +extern DL_IMPORT typeobject Listtype; #define is_listobject(op) ((op)->ob_type == &Listtype) diff --git a/Include/longobject.h b/Include/longobject.h index ce2cd0b8eea..4c21e7a665c 100644 --- a/Include/longobject.h +++ b/Include/longobject.h @@ -32,7 +32,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. typedef struct _longobject longobject; /* Revealed in longintrepr.h */ -extern typeobject Longtype; +extern DL_IMPORT typeobject Longtype; #define is_longobject(op) ((op)->ob_type == &Longtype) diff --git a/Include/mappingobject.h b/Include/mappingobject.h index 8844c77165e..caedbc75499 100644 --- a/Include/mappingobject.h +++ b/Include/mappingobject.h @@ -30,7 +30,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* Mapping object type -- mapping from hashable object to object */ -extern typeobject Mappingtype; +extern DL_IMPORT typeobject Mappingtype; #define is_mappingobject(op) ((op)->ob_type == &Mappingtype) diff --git a/Include/methodobject.h b/Include/methodobject.h index 1ef19aab463..5799a185909 100644 --- a/Include/methodobject.h +++ b/Include/methodobject.h @@ -30,7 +30,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* Method object interface */ -extern typeobject Methodtype; +extern DL_IMPORT typeobject Methodtype; #define is_methodobject(op) ((op)->ob_type == &Methodtype) diff --git a/Include/moduleobject.h b/Include/moduleobject.h index 0605d314c11..3bd26427290 100644 --- a/Include/moduleobject.h +++ b/Include/moduleobject.h @@ -30,7 +30,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* Module object interface */ -extern typeobject Moduletype; +extern DL_IMPORT typeobject Moduletype; #define is_moduleobject(op) ((op)->ob_type == &Moduletype) diff --git a/Include/object.h b/Include/object.h index cf10ec51817..e4195674c95 100644 --- a/Include/object.h +++ b/Include/object.h @@ -227,7 +227,7 @@ typedef struct _typeobject { #endif } typeobject; -extern typeobject Typetype; /* The type of type objects */ +extern DL_IMPORT typeobject Typetype; /* The type of type objects */ #define is_typeobject(op) ((op)->ob_type == &Typetype) @@ -341,7 +341,7 @@ where NULL (nil) is not suitable (since NULL often means 'error'). Don't forget to apply INCREF() when returning this value!!! */ -extern object NoObject; /* Don't use this directly */ +extern DL_IMPORT object NoObject; /* Don't use this directly */ #define None (&NoObject) diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 050ff192f26..33c7806ac80 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -39,25 +39,25 @@ void err_clear PROTO((void)); /* Predefined exceptions */ -extern object *AccessError; -extern object *AttributeError; -extern object *ConflictError; -extern object *EOFError; -extern object *IOError; -extern object *ImportError; -extern object *IndexError; -extern object *KeyError; -extern object *KeyboardInterrupt; -extern object *MemoryError; -extern object *NameError; -extern object *OverflowError; -extern object *RuntimeError; -extern object *SyntaxError; -extern object *SystemError; -extern object *SystemExit; -extern object *TypeError; -extern object *ValueError; -extern object *ZeroDivisionError; +extern DL_IMPORT object *AccessError; +extern DL_IMPORT object *AttributeError; +extern DL_IMPORT object *ConflictError; +extern DL_IMPORT object *EOFError; +extern DL_IMPORT object *IOError; +extern DL_IMPORT object *ImportError; +extern DL_IMPORT object *IndexError; +extern DL_IMPORT object *KeyError; +extern DL_IMPORT object *KeyboardInterrupt; +extern DL_IMPORT object *MemoryError; +extern DL_IMPORT object *NameError; +extern DL_IMPORT object *OverflowError; +extern DL_IMPORT object *RuntimeError; +extern DL_IMPORT object *SyntaxError; +extern DL_IMPORT object *SystemError; +extern DL_IMPORT object *SystemExit; +extern DL_IMPORT object *TypeError; +extern DL_IMPORT object *ValueError; +extern DL_IMPORT object *ZeroDivisionError; /* Convenience functions */ diff --git a/Include/rangeobject.h b/Include/rangeobject.h index 9befd9b7294..50d660b2139 100644 --- a/Include/rangeobject.h +++ b/Include/rangeobject.h @@ -34,7 +34,7 @@ Range objects behave like the corresponding tuple objects except that they are represented by a start, stop, and step datamembers. */ -extern typeobject Rangetype; +extern DL_IMPORT typeobject Rangetype; #define is_rangeobject(op) ((op)->ob_type == &Rangetype) diff --git a/Include/stringobject.h b/Include/stringobject.h index 6896a557f75..b6ec1c8ca3e 100644 --- a/Include/stringobject.h +++ b/Include/stringobject.h @@ -57,7 +57,7 @@ typedef struct { char ob_sval[1]; } stringobject; -extern typeobject Stringtype; +extern DL_IMPORT typeobject Stringtype; #define is_stringobject(op) ((op)->ob_type == &Stringtype) diff --git a/Include/sysmodule.h b/Include/sysmodule.h index 93e3a51d449..e48e4a32e76 100644 --- a/Include/sysmodule.h +++ b/Include/sysmodule.h @@ -35,7 +35,7 @@ int sysset PROTO((char *, object *)); FILE *sysgetfile PROTO((char *, FILE *)); void initsys PROTO((void)); -extern object *sys_trace, *sys_profile; +extern DL_IMPORT object *sys_trace, *sys_profile; #ifdef __cplusplus } diff --git a/Include/tupleobject.h b/Include/tupleobject.h index b422a402404..f89c655b2f0 100644 --- a/Include/tupleobject.h +++ b/Include/tupleobject.h @@ -49,7 +49,7 @@ typedef struct { object *ob_item[1]; } tupleobject; -extern typeobject Tupletype; +extern DL_IMPORT typeobject Tupletype; #define is_tupleobject(op) ((op)->ob_type == &Tupletype)