From patchwork Mon Feb 9 23:20:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 5011 Received: (qmail 8251 invoked by alias); 9 Feb 2015 23:51:41 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 8238 invoked by uid 89); 9 Feb 2015 23:51:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 09 Feb 2015 23:51:40 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t19NKvbt006855 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 9 Feb 2015 18:20:57 -0500 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t19NKkuW026307 for ; Mon, 9 Feb 2015 18:20:56 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 07/36] Make array object extern Date: Mon, 9 Feb 2015 23:20:17 +0000 Message-Id: <1423524046-20605-8-git-send-email-palves@redhat.com> In-Reply-To: <1423524046-20605-1-git-send-email-palves@redhat.com> References: <1423524046-20605-1-git-send-email-palves@redhat.com> MIME-Version: 1.0 Compiling python.c in C++ mode, we get: ...src/gdb/python/python.c: At global scope: ...src/gdb/python/python.c:106:31: error: storage size of ‘GdbMethods’ isn’t known static PyMethodDef GdbMethods[]; ^ Fix it by making the affected array objects extern. gdb/ChangeLog: 2015-02-09 Pedro Alves * python/python.c (GdbMethods): Rename to ... (python_GdbMethods): ... this and make extern. (GdbModuleDef): Rename to ... (python_GdbModuleDef): ... this and make extern. --- gdb/python/python.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gdb/python/python.c b/gdb/python/python.c index 9854c79..a13638f 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -103,10 +103,10 @@ const struct extension_language_defn extension_language_python = int gdb_python_initialized; -static PyMethodDef GdbMethods[]; +extern PyMethodDef python_GdbMethods[]; #ifdef IS_PY3K -static struct PyModuleDef GdbModuleDef; +extern struct PyModuleDef python_GdbModuleDef; #endif PyObject *gdb_module; @@ -1712,11 +1712,11 @@ message == an error message without a stack will be printed."), PyEval_InitThreads (); #ifdef IS_PY3K - gdb_module = PyModule_Create (&GdbModuleDef); + gdb_module = PyModule_Create (&python_GdbModuleDef); /* Add _gdb module to the list of known built-in modules. */ _PyImport_FixupBuiltin (gdb_module, "_gdb"); #else - gdb_module = Py_InitModule ("_gdb", GdbMethods); + gdb_module = Py_InitModule ("_gdb", python_GdbMethods); #endif if (gdb_module == NULL) goto fail; @@ -1932,7 +1932,7 @@ gdbpy_initialized (const struct extension_language_defn *extlang) #ifdef HAVE_PYTHON -static PyMethodDef GdbMethods[] = +PyMethodDef python_GdbMethods[] = { { "history", gdbpy_history, METH_VARARGS, "Get a value from history" }, @@ -2044,7 +2044,7 @@ Return a tuple containing all inferiors." }, }; #ifdef IS_PY3K -static struct PyModuleDef GdbModuleDef = +struct PyModuleDef python_GdbModuleDef = { PyModuleDef_HEAD_INIT, "_gdb",