Skip to content

Commit a745a57

Browse files
author
guido
committed
Changes for dynamic linking under NT
git-svn-id: http://svn.python.org/projects/python/trunk@4247 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent a1e61e2 commit a745a57

21 files changed

+72
-59
lines changed

Include/accessobject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4646
#define AC_R_PUBLIC 0004
4747
#define AC_W_PUBLIC 0002
4848

49-
extern typeobject Accesstype;
49+
extern DL_IMPORT typeobject Accesstype;
5050

5151
#define is_accessobject(v) ((v)->ob_type == &Accesstype)
5252

@@ -58,7 +58,7 @@ void setaccessowner PROTO((object *, object *));
5858
object *cloneaccessobject PROTO((object *));
5959
int hasaccessvalue PROTO((object *));
6060

61-
extern typeobject Anynumbertype, Anysequencetype, Anymappingtype;
61+
extern DL_IMPORT typeobject Anynumbertype, Anysequencetype, Anymappingtype;
6262

6363
#ifdef __cplusplus
6464
}

Include/allobjects.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3030

3131
/* "allobjects.c" -- Source for precompiled header "allobjects.h" */
3232

33+
/* Some systems (well, NT anyway!) require special declarations for
34+
data items imported from dynamic modules. Note that this defn is
35+
only turned on for the modules built as DL modules, not for python
36+
itself.
37+
*/
38+
#define DL_IMPORT /* Save lots of #else/#if's */
39+
#ifdef USE_DL_IMPORT
40+
#ifdef NT
41+
#undef DL_IMPORT
42+
#define DL_IMPORT __declspec(dllimport)
43+
#endif /* NT */
44+
#endif /* USE_DL_IMPORT */
45+
3346
#ifdef HAVE_CONFIG_H
3447
#include "config.h"
3548
#endif

Include/classobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ typedef struct {
5757
#endif
5858
} instanceobject;
5959

60-
extern typeobject Classtype, Instancetype, Instancemethodtype;
60+
extern DL_IMPORT typeobject Classtype, Instancetype, Instancemethodtype;
6161

6262
#define is_classobject(op) ((op)->ob_type == &Classtype)
6363
#define is_instanceobject(op) ((op)->ob_type == &Instancetype)

Include/compile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ typedef struct {
4747
object *co_name; /* string */
4848
} codeobject;
4949

50-
extern typeobject Codetype;
50+
extern DL_IMPORT typeobject Codetype;
5151

5252
#define is_codeobject(op) ((op)->ob_type == &Codetype)
5353

Include/errors.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,25 @@ void err_clear PROTO((void));
3939

4040
/* Predefined exceptions */
4141

42-
extern object *AccessError;
43-
extern object *AttributeError;
44-
extern object *ConflictError;
45-
extern object *EOFError;
46-
extern object *IOError;
47-
extern object *ImportError;
48-
extern object *IndexError;
49-
extern object *KeyError;
50-
extern object *KeyboardInterrupt;
51-
extern object *MemoryError;
52-
extern object *NameError;
53-
extern object *OverflowError;
54-
extern object *RuntimeError;
55-
extern object *SyntaxError;
56-
extern object *SystemError;
57-
extern object *SystemExit;
58-
extern object *TypeError;
59-
extern object *ValueError;
60-
extern object *ZeroDivisionError;
42+
extern DL_IMPORT object *AccessError;
43+
extern DL_IMPORT object *AttributeError;
44+
extern DL_IMPORT object *ConflictError;
45+
extern DL_IMPORT object *EOFError;
46+
extern DL_IMPORT object *IOError;
47+
extern DL_IMPORT object *ImportError;
48+
extern DL_IMPORT object *IndexError;
49+
extern DL_IMPORT object *KeyError;
50+
extern DL_IMPORT object *KeyboardInterrupt;
51+
extern DL_IMPORT object *MemoryError;
52+
extern DL_IMPORT object *NameError;
53+
extern DL_IMPORT object *OverflowError;
54+
extern DL_IMPORT object *RuntimeError;
55+
extern DL_IMPORT object *SyntaxError;
56+
extern DL_IMPORT object *SystemError;
57+
extern DL_IMPORT object *SystemExit;
58+
extern DL_IMPORT object *TypeError;
59+
extern DL_IMPORT object *ValueError;
60+
extern DL_IMPORT object *ZeroDivisionError;
6161

6262
/* Convenience functions */
6363

Include/fileobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3030

3131
/* File object interface */
3232

33-
extern typeobject Filetype;
33+
extern DL_IMPORT typeobject Filetype;
3434

3535
#define is_fileobject(op) ((op)->ob_type == &Filetype)
3636

Include/floatobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ typedef struct {
3939
double ob_fval;
4040
} floatobject;
4141

42-
extern typeobject Floattype;
42+
extern DL_IMPORT typeobject Floattype;
4343

4444
#define is_floatobject(op) ((op)->ob_type == &Floattype)
4545

Include/frameobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ typedef struct _frame {
5858

5959
/* Standard object interface */
6060

61-
extern typeobject Frametype;
61+
extern DL_IMPORT typeobject Frametype;
6262

6363
#define is_frameobject(op) ((op)->ob_type == &Frametype)
6464

Include/funcobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ typedef struct {
3939
object *func_argdefs;
4040
} funcobject;
4141

42-
extern typeobject Functype;
42+
extern DL_IMPORT typeobject Functype;
4343

4444
#define is_funcobject(op) ((op)->ob_type == &Functype)
4545

Include/intobject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ typedef struct {
5050
long ob_ival;
5151
} intobject;
5252

53-
extern typeobject Inttype;
53+
extern DL_IMPORT typeobject Inttype;
5454

5555
#define is_intobject(op) ((op)->ob_type == &Inttype)
5656

@@ -69,7 +69,7 @@ Hope these macros don't conflict with other people's.
6969
Don't forget to apply INCREF() when returning True or False!!!
7070
*/
7171

72-
extern intobject FalseObject, TrueObject; /* Don't use these directly */
72+
extern DL_IMPORT intobject FalseObject, TrueObject; /* Don't use these directly */
7373

7474
#define False ((object *) &FalseObject)
7575
#define True ((object *) &TrueObject)

0 commit comments

Comments
 (0)