Message200926
When building _testcapimodule.c as a builtin module, the build fails with this error because it doesn't take into account Py_BUILD_CORE from datetime.h.
m68k-atari-mint-gcc -I. -IInclude -I/j/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Include -I/usr/include -fno-strict-aliasing -O2 -pipe -fwrapv -DNDEBUG -DPy_BUILD_CORE -c /j/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Modules/_testcapimodule.c -o Modules/_testcapimodule.o
/j/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Modules/_testcapimodule.c: In function 'test_datetime_capi':
/j/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Modules/_testcapimodule.c:1281:9: error: 'PyDateTimeAPI' undeclared (first use in this function)
/j/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Modules/_testcapimodule.c:1281:9: note: each undeclared identifier is reported only once for each function it appears in
/j/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Modules/_testcapimodule.c:1293:5: error: 'PyDateTime_IMPORT' undeclared (first use in this function)
/j/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Modules/_testcapimodule.c: In function 'test_string_from_format':
/j/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Modules/_testcapimodule.c:1444:5: warning: format '%zd' expects argument of type 'signed size_t', but argument 2 has type 'int' [-Wformat]
make: *** [Modules/_testcapimodule.o] Error 1
I fixed it by adding this around the datetime.h include in _testcapimodule.c but not sure if this is correct....
/* Differentiate between building the core module and building extension
* modules.
*/
#ifdef Py_BUILD_CORE
#undef Py_BUILD_CORE
#include "datetime.h"
#define Py_BUILD_CORE
#else
#include "datetime.h"
#endif |
|
Date |
User |
Action |
Args |
2013-10-22 11:54:06 | alanh | set | recipients:
+ alanh |
2013-10-22 11:54:06 | alanh | set | messageid: <1382442846.46.0.759535198419.issue19348@psf.upfronthosting.co.za> |
2013-10-22 11:54:06 | alanh | link | issue19348 messages |
2013-10-22 11:54:06 | alanh | create | |
|