Permalink
Browse files

Eliminated warnings on OS/X

Two 64-bit warnings.  Also turned off the ODBC deprecation warnings.  Apparently Apple has
decided not to maintain iODBC for OS/X in the future.  ODBC can still be used, but iODBC will
have to be installed separately.
  • Loading branch information...
1 parent 9423193 commit 6463a914f24b4cdf9bcba413425a4209d98abca4 @mkleehammer committed Sep 27, 2012
Showing with 10 additions and 2 deletions.
  1. +8 −0 setup.py
  2. +1 −1 src/getdata.cpp
  3. +1 −1 src/params.cpp
View
@@ -147,6 +147,14 @@ def get_compiler_settings(version_str):
# OS/X now ships with iODBC.
settings['libraries'].append('iodbc')
+ # Apple has decided they won't maintain the iODBC system in OS/X and has added deprecation warnings in 10.8.
+ # For now target 10.7 to eliminate the warnings.
+
+ # Python functions take a lot of 'char *' that really should be const. gcc complains about this *a lot*
+ settings['extra_compile_args'] = ['-Wno-write-strings', '-Wno-deprecated-declarations']
+
+ settings['define_macros'].append( ('MAC_OS_X_VERSION_10_7',) )
+
else:
# Other posix-like: Linux, Solaris, etc.
View
@@ -257,7 +257,7 @@ class DataBuffer
I(bufferOwner == 0);
PyObject* result = PyUnicode_FromSQLWCHAR((const SQLWCHAR*)buffer, bytesUsed / element_size);
if (result == 0)
- return false;
+ return 0;
pyodbc_free(buffer);
buffer = 0;
return result;
View
@@ -343,7 +343,7 @@ static char* CreateDecimalString(long sign, PyObject* digits, long exp)
long count = (long)PyTuple_GET_SIZE(digits);
char* pch;
- int len;
+ long len;
if (exp >= 0)
{

0 comments on commit 6463a91

Please sign in to comment.