php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29488 PHP does not compile with freetds 0.62.4
Submitted: 2004-08-02 10:02 UTC Modified: 2004-08-23 19:18 UTC
From: ssc at coolspot dot de Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.3.8 OS: Linux 2.6.7 / Debian sarge
Private report: No CVE-ID: None
 [2004-08-02 10:02 UTC] ssc at coolspot dot de
Description:
------------
I installed freetds version 0.62.4 on some debian sarge system, using
./configure --prefix=/usr/freetds --enable-msdblib --with-tdsver=8.0 --enable-shared
echo "/usr/freetds/lib" >> /etc/ld.so.conf ; ldconfig
FreeTDS work ok.
I then tried to compile php with
... --with-mssql=/usr/freetds ...
and to link it against freetds resulting in :

In file included from /root/php-4.3.8/ext/mssql/php_mssql.c:33:
/root/php-4.3.8/ext/mssql/php_mssql.h:41: error: redefinition of `SHORT'
/usr/freetds/include/sybdb.h:117: error: `SHORT' previously declared here
make: *** [ext/mssql/php_mssql.lo] Fehler 1

I commented out the line 41 in ext/mssql/php_mssql.h,
which is only a typdef short SHORT;, and it then worked,
as expected.

Compiler Version used is :
Lese Spezifikationen von /usr/lib/gcc-lib/i486-linux/3.3.4/specs
Konfiguriert mit: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread-Modell: posix
gcc-Version 3.3.4 (Debian 1:3.3.4-3)



Reproduce code:
---------------
Any

Expected result:
----------------
Should compile

Actual result:
--------------
Does not compile

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-03 11:42 UTC] patrick dot schutte at gmx dot de
it's not a freetds-Problem - the mssql-extentions in php-4.3.7, 4.3.8 causes the errors - try php-5.0.0 or 4.3.6
 [2004-08-03 13:17 UTC] ssc at coolspot dot de
Ha,ha.
Is there somebody out there to fix the bug or
do i realy have to do a diff -wu myself ?
Ok, for your convinience :

>>>
stefan@hal9000:~/php-shit$ diff -wu php-4.3.6/ext/mssql/php_mssql.h php-4.3.8/ext/mssql/php_mssql.h
--- php-4.3.6/ext/mssql/php_mssql.h     2003-07-23 18:53:38.000000000 +0200
+++ php-4.3.8/ext/mssql/php_mssql.h     2004-04-21 01:37:26.000000000 +0200
@@ -17,7 +17,7 @@
  */


-/* $Id: php_mssql.h,v 1.23.4.9 2003/07/23 16:53:38 iliaa Exp $ */
+/* $Id: php_mssql.h,v 1.23.4.10 2004/04/20 23:37:26 fmk Exp $ */

 #ifndef PHP_MSSQL_H
 #define PHP_MSSQL_H
@@ -37,6 +37,9 @@
 #include "sqldb.h"

 #if HAVE_FREETDS
+#ifndef SHORT
+typedef short SHORT;
+#endif
 #define SQLTEXT SYBTEXT
 #define SQLCHAR SYBCHAR
 #define SQLVARCHAR SYBVARCHAR
<<<

#ifndef SHORT searches for pre-compiler defines not for
typedefs. But typedef is C not Pre-Processor define.
mh.
Ok, now I really know what PHP is all about.

Use PHP 5 ? An older release ?
 [2004-08-10 11:09 UTC] patrick dot schutte at gmx dot de
Hi, downlaod the laest snap and copy the ext/mssql folder to your php-4.3.8 folder. I just compiled php-4.3.9dev (latest snap - 200408100430 -) with freetds-0.62.4 it wokrs fine! No Errors. HTH
 [2004-08-23 19:18 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Aug 16 08:01:28 2024 UTC