]> granicus.if.org Git - python/commitdiff
Cruft removal:
authorNeal Norwitz <nnorwitz@gmail.com>
Thu, 28 Dec 2006 04:47:50 +0000 (04:47 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Thu, 28 Dec 2006 04:47:50 +0000 (04:47 +0000)
 * DL_IMPORT/DL_EXPORT
 * #if 0'd code
 * Py_PROTO which was obsolete, but still used in one place in addrinfo.h

Include/Python.h
Include/pyport.h
Modules/_bsddb.c
Modules/_ctypes/_ctypes_test.c
Modules/_elementtree.c
Modules/addrinfo.h

index d75854cae8de8530e3d7e265f501ad8ec5e638a7..397ceb99ff27c7735eb0c0a137bab59d274792c4 100644 (file)
 
 #include "pyport.h"
 
-/* pyconfig.h or pyport.h may or may not define DL_IMPORT */
-#ifndef DL_IMPORT      /* declarations for DLL import/export */
-#define DL_IMPORT(RTYPE) RTYPE
-#endif
-#ifndef DL_EXPORT      /* declarations for DLL import/export */
-#define DL_EXPORT(RTYPE) RTYPE
-#endif
-
 /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
  *  PYMALLOC_DEBUG is in error if pymalloc is not in use.
  */
index 36d517cd99dac61cf8cb132e0714d48aa8cb135c..fb57aceb37094f1c49d138847cecb6fbe3e0753c 100644 (file)
@@ -35,17 +35,6 @@ Used in:  PY_LONG_LONG
 
 **************************************************************************/
 
-
-/* For backward compatibility only. Obsolete, do not use. */
-#ifdef HAVE_PROTOTYPES
-#define Py_PROTO(x) x
-#else
-#define Py_PROTO(x) ()
-#endif
-#ifndef Py_FPROTO
-#define Py_FPROTO(x) Py_PROTO(x)
-#endif
-
 /* typedefs for some C9X-defined synonyms for integral types.
  *
  * The names in Python are exactly the same as the C9X names, except with a
@@ -226,9 +215,7 @@ typedef Py_intptr_t Py_ssize_t;
 /* NB caller must include <sys/types.h> */
 
 #ifdef HAVE_SYS_SELECT_H
-
 #include <sys/select.h>
-
 #endif /* !HAVE_SYS_SELECT_H */
 
 /*******************************
@@ -504,7 +491,7 @@ extern int gethostname(char *, int);
 #ifdef __BEOS__
 /* Unchecked */
 /* It's in the libs, but not the headers... - [cjh] */
-int shutdown( int, int );
+int shutdown(int, int);
 #endif
 
 #ifdef HAVE__GETPTY
@@ -523,25 +510,6 @@ extern int forkpty(int *, char *, struct termios *, struct winsize *);
 #endif /* defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) */
 
 
-/* These are pulled from various places. It isn't obvious on what platforms
-   they are necessary, nor what the exact prototype should look like (which
-   is likely to vary between platforms!) If you find you need one of these
-   declarations, please move them to a platform-specific block and include
-   proper prototypes. */
-#if 0
-
-/* From Modules/resource.c */
-extern int getrusage();
-extern int getpagesize();
-
-/* From Python/sysmodule.c and Modules/posixmodule.c */
-extern int fclose(FILE *);
-
-/* From Modules/posixmodule.c */
-extern int fdatasync(int);
-#endif /* 0 */
-
-
 /************************
  * WRAPPER FOR <math.h> *
  ************************/
@@ -651,56 +619,6 @@ extern double hypot(double, double);
 #      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,
-   here is a set that should do the job */
-
-#if 0 /* disabled and probably obsolete */
-
-#ifndef        FD_SETSIZE
-#define        FD_SETSIZE      256
-#endif
-
-#ifndef FD_SET
-
-typedef long fd_mask;
-
-#define NFDBITS        (sizeof(fd_mask) * NBBY)        /* bits per mask */
-#ifndef howmany
-#define        howmany(x, y)   (((x)+((y)-1))/(y))
-#endif /* howmany */
-
-typedef        struct fd_set {
-       fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
-} fd_set;
-
-#define        FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
-#define        FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
-#define        FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
-#define FD_ZERO(p)     memset((char *)(p), '\0', sizeof(*(p)))
-
-#endif /* FD_SET */
-
-#endif /* fd manipulation macros */
-
-
 /* limits.h constants that may be missing */
 
 #ifndef INT_MAX
index 79f06dcf0ab5d317a387dd5895198ea282a86b63..68489e9a48e565b41d9c5d9a836f77043ce209fc 100644 (file)
@@ -5627,7 +5627,7 @@ static PyMethodDef bsddb_methods[] = {
 #define MODULE_NAME_MAX_LEN     11
 static char _bsddbModuleName[MODULE_NAME_MAX_LEN+1] = "_bsddb";
 
-DL_EXPORT(void) init_bsddb(void)
+PyMODINIT_FUNC init_bsddb(void)
 {
     PyObject* m;
     PyObject* d;
@@ -6032,7 +6032,7 @@ DL_EXPORT(void) init_bsddb(void)
 /* allow this module to be named _pybsddb so that it can be installed
  * and imported on top of python >= 2.3 that includes its own older
  * copy of the library named _bsddb without importing the old version. */
-DL_EXPORT(void) init_pybsddb(void)
+PyMODINIT_FUNC init_pybsddb(void)
 {
     strncpy(_bsddbModuleName, "_pybsddb", MODULE_NAME_MAX_LEN);
     init_bsddb();
index d13fec4e9ead92e2cc0af9ea836266becc7e7f9c..9e7c212bc41ad9858a1e7e6f947b4d781af35db0 100644 (file)
@@ -330,7 +330,7 @@ struct BITS {
        short M: 1, N: 2, O: 3, P: 4, Q: 5, R: 6, S: 7;
 };
 
-DL_EXPORT(void) set_bitfields(struct BITS *bits, char name, int value)
+PyAPI_FUNC(void) set_bitfields(struct BITS *bits, char name, int value)
 {
        switch (name) {
        case 'A': bits->A = value; break;
@@ -353,7 +353,7 @@ DL_EXPORT(void) set_bitfields(struct BITS *bits, char name, int value)
        }
 }
 
-DL_EXPORT(int) unpack_bitfields(struct BITS *bits, char name)
+PyAPI_FUNC(int) unpack_bitfields(struct BITS *bits, char name)
 {
        switch (name) {
        case 'A': return bits->A;
@@ -547,7 +547,7 @@ EXPORT (HRESULT) KeepObject(IUnknown *punk)
 
 #endif
 
-DL_EXPORT(void)
+PyMODINIT_FUNC
 init_ctypes_test(void)
 {
        Py_InitModule("_ctypes_test", module_methods);
index e5d61c67ff486fed6332c83c3429296f2a8c847e..2766b41758ebd98887621088fa1f89dc333b4ee3 100644 (file)
@@ -2612,7 +2612,7 @@ static PyMethodDef _functions[] = {
     {NULL, NULL}
 };
 
-DL_EXPORT(void)
+PyMODINIT_FUNC
 init_elementtree(void)
 {
     PyObject* m;
index 6f67a2e957e7be08548a16fe978026ecb0ad8eb4..fe7e96f1baff3fdd68f9a5384f85ab1c968f2db0 100644 (file)
@@ -170,7 +170,7 @@ struct sockaddr_storage {
 #ifdef __cplusplus
 extern "C" {
 #endif
-extern void freehostent Py_PROTO((struct hostent *));
+extern void freehostent(struct hostent *);
 #ifdef __cplusplus
 }
 #endif