]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
make the type a parameter of the DL_IMPORT macro, for Borland C
authorGuido van Rossum <guido@python.org>
Mon, 27 Feb 1995 10:17:52 +0000 (10:17 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 27 Feb 1995 10:17:52 +0000 (10:17 +0000)
22 files changed:
Include/accessobject.h
Include/allobjects.h
Include/classobject.h
Include/compile.h
Include/errors.h
Include/fileobject.h
Include/floatobject.h
Include/frameobject.h
Include/funcobject.h
Include/intobject.h
Include/listobject.h
Include/longobject.h
Include/mappingobject.h
Include/methodobject.h
Include/moduleobject.h
Include/object.h
Include/osdefs.h
Include/pyerrors.h
Include/rangeobject.h
Include/stringobject.h
Include/sysmodule.h
Include/tupleobject.h

index 47f98955fc60d48485c8bc8e5967f31e0dbced52..0ea60fc03a060b872990389bf1e9bb0dc16fbe7c 100644 (file)
@@ -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 DL_IMPORT PyTypeObject PyAccess_Type;
+extern DL_IMPORT(PyTypeObject) PyAccess_Type;
 
 #define PyAccess_Check(v) ((v)->ob_type == &PyAccess_Type)
 
@@ -58,7 +58,7 @@ void PyAccess_SetOwner Py_PROTO((PyObject *, PyObject *));
 PyObject *PyAccess_Clone Py_PROTO((PyObject *));
 int PyAccess_HasValue Py_PROTO((PyObject *));
 
-extern DL_IMPORT PyTypeObject PyAnyNumber_Type, PyAnySequence_Type, PyAnyMapping_Type;
+extern DL_IMPORT(PyTypeObject) PyAnyNumber_Type, PyAnySequence_Type, PyAnyMapping_Type;
 
 #ifdef __cplusplus
 }
index 6dbdb1e58e58b9db3e013bcaa1163c09b5b896af..b156e2e8be7dbd2f0f1da015a5067a50c0b24f86 100644 (file)
@@ -35,12 +35,16 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  only turned on for the modules built as DL modules, not for python
  itself.
 */
-#define DL_IMPORT /* Save lots of #else/#if's */
+#define DL_IMPORT( RTYPE ) RTYPE /* Save lots of #else/#if's */
 #ifdef USE_DL_IMPORT
 #ifdef NT
 #undef DL_IMPORT
-#define DL_IMPORT __declspec(dllimport)
+#define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
 #endif /* NT */
+#ifdef __BORLANDC__
+#undef DL_IMPORT
+#define DL_IMPORT(RTYPE)  RTYPE __import
+#endif /* BORLANDC */
 #endif /* USE_DL_IMPORT */
 
 #ifdef HAVE_CONFIG_H
index 98100095b4447f0785a8561b7b73f1197e93c405..f87d02e8722eaee98dca5140d97dac0e0965a40a 100644 (file)
@@ -55,7 +55,7 @@ typedef struct {
        PyObject        *in_dict;       /* A dictionary */
 } PyInstanceObject;
 
-extern DL_IMPORT PyTypeObject PyClass_Type, PyInstance_Type, PyMethod_Type;
+extern DL_IMPORT(PyTypeObject) PyClass_Type, PyInstance_Type, PyMethod_Type;
 
 #define PyClass_Check(op) ((op)->ob_type == &PyClass_Type)
 #define PyInstance_Check(op) ((op)->ob_type == &PyInstance_Type)
index 4513d283705059b61573ba2b84bd75736a944cf8..f311a4ba20d43fb525e1b84055f5b3384ef319b1 100644 (file)
@@ -47,7 +47,7 @@ typedef struct {
        PyObject *co_name;      /* string */
 } PyCodeObject;
 
-extern DL_IMPORT PyTypeObject PyCode_Type;
+extern DL_IMPORT(PyTypeObject) PyCode_Type;
 
 #define PyCode_Check(op) ((op)->ob_type == &PyCode_Type)
 
index 893bc90cb8a7b7ccf82c48383630e93686d9afd1..3307b3686cad90a9afdf87309397e66d188ad3e4 100755 (executable)
@@ -40,25 +40,25 @@ void PyErr_Restore Py_PROTO((PyObject *, PyObject *, PyObject *));
 
 /* Predefined exceptions */
 
-extern DL_IMPORT PyObject *PyExc_AccessError;
-extern DL_IMPORT PyObject *PyExc_AttributeError;
-extern DL_IMPORT PyObject *PyExc_ConflictError;
-extern DL_IMPORT PyObject *PyExc_EOFError;
-extern DL_IMPORT PyObject *PyExc_IOError;
-extern DL_IMPORT PyObject *PyExc_ImportError;
-extern DL_IMPORT PyObject *PyExc_IndexError;
-extern DL_IMPORT PyObject *PyExc_KeyError;
-extern DL_IMPORT PyObject *PyExc_KeyboardInterrupt;
-extern DL_IMPORT PyObject *PyExc_MemoryError;
-extern DL_IMPORT PyObject *PyExc_NameError;
-extern DL_IMPORT PyObject *PyExc_OverflowError;
-extern DL_IMPORT PyObject *PyExc_RuntimeError;
-extern DL_IMPORT PyObject *PyExc_SyntaxError;
-extern DL_IMPORT PyObject *PyExc_SystemError;
-extern DL_IMPORT PyObject *PyExc_SystemExit;
-extern DL_IMPORT PyObject *PyExc_TypeError;
-extern DL_IMPORT PyObject *PyExc_ValueError;
-extern DL_IMPORT PyObject *PyExc_ZeroDivisionError;
+extern DL_IMPORT(PyObject *) PyExc_AccessError;
+extern DL_IMPORT(PyObject *) PyExc_AttributeError;
+extern DL_IMPORT(PyObject *) PyExc_ConflictError;
+extern DL_IMPORT(PyObject *) PyExc_EOFError;
+extern DL_IMPORT(PyObject *) PyExc_IOError;
+extern DL_IMPORT(PyObject *) PyExc_ImportError;
+extern DL_IMPORT(PyObject *) PyExc_IndexError;
+extern DL_IMPORT(PyObject *) PyExc_KeyError;
+extern DL_IMPORT(PyObject *) PyExc_KeyboardInterrupt;
+extern DL_IMPORT(PyObject *) PyExc_MemoryError;
+extern DL_IMPORT(PyObject *) PyExc_NameError;
+extern DL_IMPORT(PyObject *) PyExc_OverflowError;
+extern DL_IMPORT(PyObject *) PyExc_RuntimeError;
+extern DL_IMPORT(PyObject *) PyExc_SyntaxError;
+extern DL_IMPORT(PyObject *) PyExc_SystemError;
+extern DL_IMPORT(PyObject *) PyExc_SystemExit;
+extern DL_IMPORT(PyObject *) PyExc_TypeError;
+extern DL_IMPORT(PyObject *) PyExc_ValueError;
+extern DL_IMPORT(PyObject *) PyExc_ZeroDivisionError;
 
 /* Convenience functions */
 
index 85c98c6ab5b44376b3e8870532a0a9f556f44144..93466247b4af772c7fc0d54807dc1f6e666e0d76 100644 (file)
@@ -30,7 +30,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 /* File object interface */
 
-extern DL_IMPORT PyTypeObject PyFile_Type;
+extern DL_IMPORT(PyTypeObject) PyFile_Type;
 
 #define PyFile_Check(op) ((op)->ob_type == &PyFile_Type)
 
index 2feb0bcea5b6f16cfa712f3e57cd29760142ca68..ba23f77a4b87c3419b27aad688071de4174123a5 100644 (file)
@@ -39,7 +39,7 @@ typedef struct {
        double ob_fval;
 } PyFloatObject;
 
-extern DL_IMPORT PyTypeObject PyFloat_Type;
+extern DL_IMPORT(PyTypeObject) PyFloat_Type;
 
 #define PyFloat_Check(op) ((op)->ob_type == &PyFloat_Type)
 
index 949016a47b77b862bf2304a420caf8b8aafd0aea..e0c94e0861b2c3ed990695f89e720ad8561ba326 100644 (file)
@@ -61,7 +61,7 @@ typedef struct _frame {
 
 /* Standard object interface */
 
-extern DL_IMPORT PyTypeObject PyFrame_Type;
+extern DL_IMPORT(PyTypeObject) PyFrame_Type;
 
 #define PyFrame_Check(op) ((op)->ob_type == &PyFrame_Type)
 
index d33cad755b4cdcc18b9eecb1bdb7d7b766525237..f618363cf224ac004b0cab750065af94cb7d697a 100644 (file)
@@ -40,7 +40,7 @@ typedef struct {
        PyObject *func_doc;
 } PyFunctionObject;
 
-extern DL_IMPORT PyTypeObject PyFunction_Type;
+extern DL_IMPORT(PyTypeObject) PyFunction_Type;
 
 #define PyFunction_Check(op) ((op)->ob_type == &PyFunction_Type)
 
index 6e2344a50901d41fcc453f75ae73a6c162608ba6..24bcbf063d43657a2fd6b0ebc358f39947393ee4 100644 (file)
@@ -50,7 +50,7 @@ typedef struct {
        long ob_ival;
 } PyIntObject;
 
-extern DL_IMPORT PyTypeObject PyInt_Type;
+extern DL_IMPORT(PyTypeObject) PyInt_Type;
 
 #define PyInt_Check(op) ((op)->ob_type == &PyInt_Type)
 
@@ -69,7 +69,7 @@ Hope these macros don't conflict with other people's.
 Don't forget to apply Py_INCREF() when returning True or False!!!
 */
 
-extern DL_IMPORT PyIntObject _Py_ZeroStruct, _Py_TrueStruct; /* Don't use these directly */
+extern DL_IMPORT(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct; /* Don't use these directly */
 
 #define Py_False ((PyObject *) &_Py_ZeroStruct)
 #define Py_True ((PyObject *) &_Py_TrueStruct)
index 8e5e9731b1666ce40463f99ae8a4757e0eec82fe..76b49be334e68a0d55e785b536c875c83feec526 100644 (file)
@@ -49,7 +49,7 @@ typedef struct {
        PyObject **ob_item;
 } PyListObject;
 
-extern DL_IMPORT PyTypeObject PyList_Type;
+extern DL_IMPORT(PyTypeObject) PyList_Type;
 
 #define PyList_Check(op) ((op)->ob_type == &PyList_Type)
 
index 2a34417daf2c5478455c6e3b4b0e1139e14f6cb7..77e5efe96648a8f652b354634a3c5a503ce273ff 100644 (file)
@@ -32,7 +32,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 typedef struct _longobject PyLongObject; /* Revealed in longintrepr.h */
 
-extern DL_IMPORT PyTypeObject PyLong_Type;
+extern DL_IMPORT(PyTypeObject) PyLong_Type;
 
 #define PyLong_Check(op) ((op)->ob_type == &PyLong_Type)
 
index f8e838c09f101623aa4acdf094321e0fd15e2a18..584ee5a48cf5f0aedc9e45b08e09269112bc645d 100644 (file)
@@ -31,7 +31,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 /* Dictionary object type -- mapping from hashable object to object */
 /* NB Should be moved back to dictobject.h */
 
-extern DL_IMPORT PyTypeObject PyDict_Type;
+extern DL_IMPORT(PyTypeObject) PyDict_Type;
 
 #define PyDict_Check(op) ((op)->ob_type == &PyDict_Type)
 
index 946d004bd5fa40c3367b5783f9aeced0aa2ac7fa..cbe3270863e49067e013d9e1fad600142d7758f9 100644 (file)
@@ -30,7 +30,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 /* Method object interface */
 
-extern DL_IMPORT PyTypeObject PyCFunction_Type;
+extern DL_IMPORT(PyTypeObject) PyCFunction_Type;
 
 #define PyCFunction_Check(op) ((op)->ob_type == &PyCFunction_Type)
 
index 277f95d321a30957a161bb49e2cfde4f78ba2870..f8eea9c8ba03f84c03dafc3da12271d5f728dc0c 100644 (file)
@@ -30,7 +30,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 /* Module object interface */
 
-extern DL_IMPORT PyTypeObject PyModule_Type;
+extern DL_IMPORT(PyTypeObject) PyModule_Type;
 
 #define PyModule_Check(op) ((op)->ob_type == &PyModule_Type)
 
index 9c9b6893fdc38b8e2a8234e6f5935a2b63a4c6e3..0b679d544d0c1d9402a5edf9df11b4ce9f2c0805 100644 (file)
@@ -237,7 +237,7 @@ typedef struct _typeobject {
 #endif
 } PyTypeObject;
 
-extern DL_IMPORT PyTypeObject PyType_Type; /* The type of type objects */
+extern DL_IMPORT(PyTypeObject) PyType_Type; /* The type of type objects */
 
 #define PyType_Check(op) ((op)->ob_type == &PyType_Type)
 
@@ -353,7 +353,7 @@ where NULL (nil) is not suitable (since NULL often means 'error').
 Don't forget to apply Py_INCREF() when returning this value!!!
 */
 
-extern DL_IMPORT PyObject _Py_NoneStruct; /* Don't use this directly */
+extern DL_IMPORT(PyObject) _Py_NoneStruct; /* Don't use this directly */
 
 #define Py_None (&_Py_NoneStruct)
 
index 25c9c362ace7077a0c1540dd32e680ff50d8a9a7..0c279f2776764b8ac38f8bb4c4e08bfcf1eba872 100644 (file)
@@ -37,7 +37,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define DELIM '\n'
 #endif
 
-#if defined(MSDOS) || defined(NT)
+#if defined(MSDOS) || defined(NT) || defined(__BORLANDC__)
 #define SEP '\\'
 #define MAXPATHLEN 256
 #define DELIM ';'
index 893bc90cb8a7b7ccf82c48383630e93686d9afd1..3307b3686cad90a9afdf87309397e66d188ad3e4 100644 (file)
@@ -40,25 +40,25 @@ void PyErr_Restore Py_PROTO((PyObject *, PyObject *, PyObject *));
 
 /* Predefined exceptions */
 
-extern DL_IMPORT PyObject *PyExc_AccessError;
-extern DL_IMPORT PyObject *PyExc_AttributeError;
-extern DL_IMPORT PyObject *PyExc_ConflictError;
-extern DL_IMPORT PyObject *PyExc_EOFError;
-extern DL_IMPORT PyObject *PyExc_IOError;
-extern DL_IMPORT PyObject *PyExc_ImportError;
-extern DL_IMPORT PyObject *PyExc_IndexError;
-extern DL_IMPORT PyObject *PyExc_KeyError;
-extern DL_IMPORT PyObject *PyExc_KeyboardInterrupt;
-extern DL_IMPORT PyObject *PyExc_MemoryError;
-extern DL_IMPORT PyObject *PyExc_NameError;
-extern DL_IMPORT PyObject *PyExc_OverflowError;
-extern DL_IMPORT PyObject *PyExc_RuntimeError;
-extern DL_IMPORT PyObject *PyExc_SyntaxError;
-extern DL_IMPORT PyObject *PyExc_SystemError;
-extern DL_IMPORT PyObject *PyExc_SystemExit;
-extern DL_IMPORT PyObject *PyExc_TypeError;
-extern DL_IMPORT PyObject *PyExc_ValueError;
-extern DL_IMPORT PyObject *PyExc_ZeroDivisionError;
+extern DL_IMPORT(PyObject *) PyExc_AccessError;
+extern DL_IMPORT(PyObject *) PyExc_AttributeError;
+extern DL_IMPORT(PyObject *) PyExc_ConflictError;
+extern DL_IMPORT(PyObject *) PyExc_EOFError;
+extern DL_IMPORT(PyObject *) PyExc_IOError;
+extern DL_IMPORT(PyObject *) PyExc_ImportError;
+extern DL_IMPORT(PyObject *) PyExc_IndexError;
+extern DL_IMPORT(PyObject *) PyExc_KeyError;
+extern DL_IMPORT(PyObject *) PyExc_KeyboardInterrupt;
+extern DL_IMPORT(PyObject *) PyExc_MemoryError;
+extern DL_IMPORT(PyObject *) PyExc_NameError;
+extern DL_IMPORT(PyObject *) PyExc_OverflowError;
+extern DL_IMPORT(PyObject *) PyExc_RuntimeError;
+extern DL_IMPORT(PyObject *) PyExc_SyntaxError;
+extern DL_IMPORT(PyObject *) PyExc_SystemError;
+extern DL_IMPORT(PyObject *) PyExc_SystemExit;
+extern DL_IMPORT(PyObject *) PyExc_TypeError;
+extern DL_IMPORT(PyObject *) PyExc_ValueError;
+extern DL_IMPORT(PyObject *) PyExc_ZeroDivisionError;
 
 /* Convenience functions */
 
index f8b466c234f2aeb293026231b24b545a7596472f..949e7100e3c02e03c0e57a59289f16b024d056d5 100644 (file)
@@ -32,7 +32,7 @@ Range objects behave like the corresponding tuple objects except that
 they are represented by a start, stop, and step datamembers.
 */
 
-extern DL_IMPORT PyTypeObject PyRange_Type;
+extern DL_IMPORT(PyTypeObject) PyRange_Type;
 
 #define PyRange_Check(op) ((op)->ob_type == &PyRange_Type)
 
index d3b6ce439b304f8f887282a527110441b6b6a780..f5ebe78ee773bf3269a3335c3c2e765f73430fef 100644 (file)
@@ -55,7 +55,7 @@ typedef struct {
        char ob_sval[1];
 } PyStringObject;
 
-extern DL_IMPORT PyTypeObject PyString_Type;
+extern DL_IMPORT(PyTypeObject) PyString_Type;
 
 #define PyString_Check(op) ((op)->ob_type == &PyString_Type)
 
index 8d317482c71968641bd4c405bd7088ad490b6eae..29e7bffb0fe2f4edce4897610d3ec13e74517adc 100644 (file)
@@ -35,8 +35,8 @@ int PySys_SetObject Py_PROTO((char *, PyObject *));
 FILE *PySys_GetFile Py_PROTO((char *, FILE *));
 void PySys_Init Py_PROTO((void));
 
-extern DL_IMPORT PyObject *_PySys_TraceFunc, *_PySys_ProfileFunc;
-extern DL_IMPORT int _PySys_CheckInterval;
+extern DL_IMPORT(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc;
+extern DL_IMPORT(int) _PySys_CheckInterval;
 
 #ifdef __cplusplus
 }
index ff606721e84d492b5b462d62ee4a9a52dd02d9ad..da7689169df6467347f4e5f014cf2fda46f2b1f1 100644 (file)
@@ -49,7 +49,7 @@ typedef struct {
        PyObject *ob_item[1];
 } PyTupleObject;
 
-extern DL_IMPORT PyTypeObject PyTuple_Type;
+extern DL_IMPORT(PyTypeObject) PyTuple_Type;
 
 #define PyTuple_Check(op) ((op)->ob_type == &PyTuple_Type)