Modifies --cflags output so that it can be used for both 32/64 bits builds. But still we seem to need to deliver both odbc_config versions for other potential use cases. Solaris/illumos specific. Not suitable for upstream. --- unixODBC-2.3.11/exe/odbc-config.c +++ unixODBC-2.3.11/exe/odbc-config.c @@ -50,6 +50,7 @@ } static void cInc( void ) { + printf( "#ifndef UODBC__conf_h\n#define UODBC__conf_h 1\n\n"); #ifdef HAVE_UNISTD_H printf( "#ifndef HAVE_UNISTD_H\n #define HAVE_UNISTD_H\n#endif\n" ); #endif @@ -83,11 +84,11 @@ printf( "#ifndef HAVE_LONG_LONG\n #defin #endif #ifdef ODBCINT64_TYPE - printf( "#ifndef ODBCINT64\n #define ODBCINT64 %s\n#endif\n", ODBCINT64_TYPE ); + printf( "#ifndef ODBCINT64\n#if defined(_LP64)\n #define ODBCINT64 long\n#else\n #define ODBCINT64 long long\n#endif\n#endif\n" ); #endif #ifdef UODBCINT64_TYPE - printf( "#ifndef UODBCINT64\n #define UODBCINT64 %s\n#endif\n", UODBCINT64_TYPE ); + printf( "#ifndef UODBCINT64\n#if defined(_LP64))\n #define ODBCINT64 unsigned long\n#else\n #define UODBCINT64 unsigned long long \n#endif\n#endif\n" ); #endif #ifdef DISABLE_INI_CACHING @@ -95,7 +96,7 @@ printf( "#ifndef DISABLE_INI_CACHING\n # #endif #ifdef SIZEOF_LONG_INT - printf( "#ifndef SIZEOF_LONG_INT\n #define SIZEOF_LONG_INT %d\n#endif\n", SIZEOF_LONG_INT ); + printf( "#ifndef SIZEOF_LONG_INT\n#if defined(_LP64)\n #define SIZEOF_LONG_INT 8\n#else\n #define SIZEOF_LONG_INT 4\n#endif\n#endif\n" ); #endif #ifdef ALREADY_HAVE_WINDOWS_TYPE @@ -129,6 +130,7 @@ #endif #ifdef ENABLE_DRIVER_ICONV printf( "#ifndef ENABLE_DRIVER_ICONV\n #define ENABLE_DRIVER_ICONV\n#endif\n" ); #endif + printf ("\n#endif /* UODBC__conf_h */\n"); } static void cflags( void )