[freetds] RETCODE conflict

Frederick N. Brier multideck at comcast.net
Wed Mar 30 07:28:45 EST 2005


Does #undef work on a typedef?  I would have thought #undef is a symbol 
in the preprocessor and typedef is a symbol in the compiler's symbol 
table.  What I am trying to do is call bcp_* routines in the dblib using 
an ODBC connection.  The approach is put together a DBPROCESS struct 
from the various TDS structs pointed to by the ODBC based structs since 
both dblib/bcp* functions in the dblib as well as the ODBC library are 
built on the same underlying TDS structs and methods.  I made most of 
the changes yesterday and will test it today.  If the typedef(s) were 
changed to #define(s) then I could potentially use the trick described 
below.  In the meantime, <wince> I did a global search and replace of 
RETCODE to TDSRETCODE in the FreeTDS source base <sigh>.  Other than 
that, I added a bulk_copy_enabled flag to the _hattr struct and methods 
to set/get it via the OBDC call, as well as use the flag on connection 
creation, by setting the value in the TDS connection info struct, which 
is then used in the assembly of the packet to the server.

Fred.

ZIGLIO, Frediano, VF-IT wrote:

>>Has any else run into a typedef conflict running FreeTDS with 
>>unixODBC 
>>and trying to include both FreeTDS's sqldb.h (which includes sybdb.h) 
>>and unixODBC's sqltypes.h?  sqltypes.h defines RETCODE as a signed 
>>short.  sybdb.h defines RETCODE as an int.  Any suggested 
>>work arounds?
>>
>>Frederick N. Brier
>>Multideck Corporation
>>
>>    
>>
>
>Both use typedefs (windows too).
>
>A possible solution can be 
>
>#include <sql.h>
>#define RETCODE DBRETCODE
>#include <sybdb.h>
>#undef RETCODE
>
>DBRETCODE ret; // dblib return code
>RETCODE rc;    // ODBC return code
>
>However I don't find the reason to include both dblib and ODBC...
>
>freddy77
>_______________________________________________
>FreeTDS mailing list
>FreeTDS at lists.ibiblio.org
>http://lists.ibiblio.org/mailman/listinfo/freetds
>
>
>  
>




More information about the FreeTDS mailing list