]> granicus.if.org Git - python/commitdiff
spread the extern "C" { } magic pixie dust around. Python itself builds now
authorAnthony Baxter <anthonybaxter@gmail.com>
Thu, 13 Apr 2006 02:06:09 +0000 (02:06 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Thu, 13 Apr 2006 02:06:09 +0000 (02:06 +0000)
using a C++ compiler. Still lots and lots of errors in the modules built by
setup.py, and a bunch of warnings from g++ in the core.

12 files changed:
Modules/getpath.c
Modules/main.c
Modules/posixmodule.c
Objects/fileobject.c
Objects/object.c
Objects/unicodeobject.c
Python/errors.c
Python/getmtime.c
Python/getopt.c
Python/import.c
Python/pystate.c
Python/pythonrun.c

index 40c36921a6100e141e9d13695a6ed4984ba9da35..8eba730ccfef82145635c32ba88a76c17630f5d9 100644 (file)
  * process to find the installed Python tree.
  */
 
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
 #ifndef VERSION
 #if defined(__VMS)
 #define VERSION "2_1"
@@ -681,3 +686,9 @@ Py_GetProgramFullPath(void)
         calculate_path();
     return progpath;
 }
+
+
+#ifdef __cplusplus
+}
+#endif
+
index ceb5bedb777ae0fe6ed97bf8d711ede3b8c917ee..28d32946277efb5ee100bef0a1105da8585c7841 100644 (file)
     "Type \"help\", \"copyright\", \"credits\" or \"license\" " \
     "for more information."
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* For Py_GetArgcArgv(); set by main() */
 static char **orig_argv;
 static int  orig_argc;
@@ -540,3 +544,8 @@ Py_GetArgcArgv(int *argc, char ***argv)
        *argc = orig_argc;
        *argv = orig_argv;
 }
+
+#ifdef __cplusplus
+}
+#endif
+
index 4cd220e425afb3f946cfece799ea09677a37da52..e07021a8f3d91e3830ed58aecff9ea2108d9393a 100644 (file)
 #    include <unixio.h>
 #endif /* defined(__VMS) */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 PyDoc_STRVAR(posix__doc__,
 "This module provides access to operating system functionality that is\n\
 standardized by the C Standard and the POSIX standard (a thinly\n\
@@ -8253,3 +8257,8 @@ INITFUNC(void)
        PyModule_AddObject(m, "statvfs_result",
                           (PyObject*) &StatVFSResultType);
 }
+
+#ifdef __cplusplus
+}
+#endif
+
index 20e71a30be0d454b74fe1a0238b06f731bd22681..185caa4c650ec90ca262a3b4cc972271102bd469 100644 (file)
 #define NEWLINE_LF 2           /* \n newline seen */
 #define NEWLINE_CRLF 4         /* \r\n newline seen */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 FILE *
 PyFile_AsFile(PyObject *f)
 {
@@ -2441,3 +2445,8 @@ Py_UniversalNewlineFread(char *buf, size_t n,
        f->f_skipnextlf = skipnextlf;
        return dst - buf;
 }
+
+#ifdef __cplusplus
+}
+#endif
+
index 0ce4332f763163a1c356274ad3accaa364e599fb..d3dda1b028e836eecbd381550fd25bd46420613c 100644 (file)
@@ -3,6 +3,10 @@
 
 #include "Python.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef Py_REF_DEBUG
 Py_ssize_t _Py_RefTotal;
 
@@ -2112,3 +2116,8 @@ _PyTrash_destroy_chain(void)
                --_PyTrash_delete_nesting;
        }
 }
+
+#ifdef __cplusplus
+}
+#endif
+
index 1e0db15f3aad8891ee86b69053893236004ce7eb..30ae6f011ff07375803d7d48b2d655c7345ae457 100644 (file)
@@ -83,6 +83,11 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 */
 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Free list for Unicode objects */
 static PyUnicodeObject *unicode_freelist;
 static int unicode_freelist_size;
@@ -7418,6 +7423,11 @@ _PyUnicode_Fini(void)
     unicode_freelist_size = 0;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
+
 /*
 Local variables:
 c-basic-offset: 4
index 7fc4c97c825d106c2865a3e025f0dac61bbccfd3..25deaa691973c442d60d187a14dea173e792a2dc 100644 (file)
@@ -16,6 +16,11 @@ extern char *strerror(int);
 
 #include <ctype.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 void
 PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback)
 {
@@ -786,3 +791,8 @@ PyErr_ProgramText(const char *filename, int lineno)
        }
        return NULL;
 }
+
+#ifdef __cplusplus
+}
+#endif
+
index f0ac89972000b2370c80a7af9a1d518cc31cc7bf..54edb531df9f07b20583f323f1894881f20ba73c 100644 (file)
@@ -6,6 +6,10 @@
 #include "Python.h"
 #include "pyconfig.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 time_t
 PyOS_GetLastModificationTime(char *path, FILE *fp)
 {
@@ -15,3 +19,8 @@ PyOS_GetLastModificationTime(char *path, FILE *fp)
        else
                return st.st_mtime;
 }
+
+#ifdef __cplusplus
+}
+#endif
+
index d80f60721e21d333a2a1c3d74fa124f4e06822b0..5429fac5ad5563eb30f4d6a063087dc876561f70 100644 (file)
 #include <stdio.h>
 #include <string.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 int _PyOS_opterr = 1;          /* generate error messages */
 int _PyOS_optind = 1;          /* index into argv array   */
 char *_PyOS_optarg = NULL;     /* optional argument       */
@@ -81,3 +85,8 @@ int _PyOS_GetOpt(int argc, char **argv, char *optstring)
 
        return option;
 }
+
+#ifdef __cplusplus
+}
+#endif
+
index c3bd275104d8537d8d3d95ff1d4cb0fb3358c43b..81027d88879430b45434f55f3e6fa83c9539eea6 100644 (file)
@@ -17,6 +17,9 @@
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
+#ifdef __cplusplus
+extern "C" { 
+#endif
 
 extern time_t PyOS_GetLastModificationTime(char *, FILE *);
                                                /* In getmtime.c */
@@ -2947,3 +2950,7 @@ PyImport_AppendInittab(char *name, void (*initfunc)(void))
 
        return PyImport_ExtendInittab(newtab);
 }
+
+#ifdef __cplusplus
+}
+#endif
index ca19b760eb39bc53abfe958151642937ec885af5..9c85b5c8cde41a6fdb5da9a810d317608deca6ac 100644 (file)
@@ -37,6 +37,10 @@ static PyThread_type_lock head_mutex = NULL; /* Protects interp->tstate_head */
 #define HEAD_LOCK() PyThread_acquire_lock(head_mutex, WAIT_LOCK)
 #define HEAD_UNLOCK() PyThread_release_lock(head_mutex)
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* The single PyInterpreterState used by this process'
    GILState implementation
 */
@@ -552,4 +556,11 @@ PyGILState_Release(PyGILState_STATE oldstate)
        else if (oldstate == PyGILState_UNLOCKED)
                PyEval_SaveThread();
 }
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* WITH_THREAD */
+
+
index 818c7609018ac346067648ed9de10c0a09d5ad89..b98d6fb991bba5508420bf0970aeb22e9d8e2542 100644 (file)
                                   _Py_GetRefTotal())
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern char *Py_GetPath(void);
 
 extern grammar _PyParser_Grammar; /* From graminit.c */
@@ -1692,3 +1696,8 @@ PyParser_SimpleParseString(const char *str, int start)
 {
        return PyParser_SimpleParseStringFlags(str, start, 0);
 }
+
+#ifdef __cplusplus
+}
+#endif
+