Skip to Content.
Sympa Menu

freetds - globally defined RETCODE variable

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Ryan D. Hatch" <Ryan AT alpinenetworking.com>
  • To: <freetds AT franklin.oit.unc.edu>
  • Subject: globally defined RETCODE variable
  • Date: Fri, 31 Aug 2001 18:42:06 -0600


I am using freetds 0.52, php 4.06. I am also using IBM DB2.

When I tried compiling php with the following command

./configure \
--with-apxs=/opt/apache_1.3.20/bin/apxs \
----with-sybase=/opt/freetds-0.52 \
--with-ibm-db2=/home/db2inst1/sqllib

It broke on me when compiling giving me a previously declared variable
error. Here is what it said:
In file included from /opt/freetds-0.52/include/sybfront.h:23,
from
/usr/src/apps/php-4.0.6/ext/sybase/php_sybase_db.h:67,
from internal_functions.c:46:
/opt/freetds-0.52/include/sybdb.h:72: conflicting types for
`RETCODE'
/home/db2inst1/sqllib/include/sqlcli.h:344: previous declaration
of `RETCODE'
make[2]: *** [internal_functions.lo] Error 1
make[2]: Leaving directory `/usr/src/apps/php-4.0.6/main'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/apps/php-4.0.6/main'
make: *** [all-recursive] Error 1

So, I changed the variable definition to read;
typedef signed short RETCODE
(this is how IBM did it in the DB2 include. I assume for Java
compatibility issues)

and it worked most of the way through the compile. It broke again later
(saying that the variable hadnt been declared), so I put it back in and
finished my make. It worked, and now freetds and DB2 both work together
nicely. I am worried though that if TDS has return codes greater than
127, then I could end up with it outputing negative return codes. If the
codes are larger that 255, then I could end up with buffer overflows.
Does anybody have any better ways of handling this? Could I just simply
rename the RETCODE variable throughout the TDS source code? Perhalps a
patch?

Thanks guys.

Ryan Hatch




Archive powered by MHonArc 2.6.24.

Top of Page