djhenderson / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Alloca isn't declared automagicaly on Solaris 10, breaks build #130

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use a solaris 10 box
2. python setup.py build
3. gcc complains about no declaration for alloca

What is the expected output? What do you see instead?
continued compilation is expected, actual output looks like this:
gcc -DNDEBUG -g -O3 -m64 -g -I/usr/local/include -fPIC -DPYODBC_VERSION=2.1.8 
-c /tmp/pyodbc-2.1.8/src/getdata.cpp -o 
build/temp.solaris-2.10-i86pc-2.6/tmp/pyodbc-2.1.8/src/getdata.o 
-Wno-write-strings
/tmp/pyodbc-2.1.8/src/getdata.cpp: In function 'PyObject* 
GetDataDecimal(Cursor*, Py_ssize_t)':
/tmp/pyodbc-2.1.8/src/getdata.cpp:401: error: 'alloca' was not declared in this 
scope
error: command 'gcc' failed with exit status 1

What version of the product are you using? On what operating system?
2.1.8 on Solaris 10

Please provide any additional information below.

To fix:
--- pyodbc.h.dist       2010-10-21 18:38:21.394755226 -0400
+++ pyodbc.h    2010-10-21 18:38:25.759881525 -0400
@@ -47,6 +47,7 @@
 #include <unicodeobject.h>
 #include <structmember.h>
 #include <datetime.h>
+#include <alloca.h>

 // Whoever wrote the datetime C module declared a static variable in the header file.  A properly conforming C/C++
 // compiler will create a new copy in every source file, meaning you can't set the value globally.  Criminy.  We'll

Original issue reported on code.google.com by pedri...@gmail.com on 21 Oct 2010 at 10:39

GoogleCodeExporter commented 9 years ago
Fixed in 2.1.9-beta01 4d39e500d9ae43542d27dadb77a40fe9213d6edc

Original comment by mkleehammer on 21 Nov 2010 at 4:51

GoogleCodeExporter commented 9 years ago
I see that a macro called __SUN__ is being tested now, but it doesn't appear to 
be defined on a solaris box:

/tmp/pyodbc/src/getdata.cpp: In function 'PyObject* GetDataDecimal(Cursor*, 
Py_ssize_t)':
/tmp/pyodbc/src/getdata.cpp:401: error: 'alloca' was not declared in this scope
error: command 'gcc' failed with exit status 1
/tmp/pyodbc $ ls
/tmp/pyodbc $ uname -a
SunOS sys2 5.10 Generic_142901-13 i86pc i386 i86pc Solaris

Original comment by pedri...@gmail.com on 22 Nov 2010 at 6:04