php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25155 compile error when combining mime-magic with mssql
Submitted: 2003-08-19 14:24 UTC Modified: 2003-08-19 17:13 UTC
From: andrew at designtek1 dot com Assigned: iliaa (profile)
Status: Closed Package: Compile Failure
PHP Version: 4.3.3RC4 OS: FreeBSD
Private report: No CVE-ID: None
 [2003-08-19 14:24 UTC] andrew at designtek1 dot com
Description:
------------
compiling fails when configured with both of the options
--with-mime-magic
--with-mssql

compiler error:
In file included from /usr/local/include/sybfront.h:23,
                 from /usr/local/include/sqlfront.h:23,
                 from /usr/ports/lang/php4/work/php-4.3.3RC4/ext/mssql/php_mssql.h:36,
                 from main/internal_functions.c:57:
/usr/local/include/sybdb.h:103: syntax error before `2'
/usr/local/include/sybdb.h:150: syntax error before `1'
/usr/local/include/sybdb.h:177: syntax error before `1'
/usr/local/include/sybdb.h:204: syntax error before `1'
/usr/local/include/sybdb.h:210: syntax error before `1'
/usr/local/include/sybdb.h:281: syntax error before `1'
/usr/local/include/sybdb.h:285: syntax error before `1'
/usr/local/include/sybdb.h:339: syntax error before `1'
/usr/local/include/sybdb.h:453: syntax error before `1'
cpp0: output pipe has been closed


i have traced this error to the fact that "ext/mime_magic/php_mime_magic.h" has lines 61 & 62:
#define BYTE    1
#define SHORT    2

the errors from the freetds headers above refer to lines:
103:typedef short    SHORT;
150:typedef unsigned char BYTE;
177:        BYTE    *terminator;
204:        BYTE    *data;
and so on....

i was able to compile successfully by changing the order of the following 2 lines in main/internal_functions.c:

#include "ext/mime_magic/php_mime_magic.h"
#include "ext/mssql/php_mssql.h"

to

#include "ext/mssql/php_mssql.h"
#include "ext/mime_magic/php_mime_magic.h"



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-19 17:13 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, 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/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

The fix for this problem is present in PHP5 and will be a part of the 4.3.X release after 4.3.3.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon Feb 16 23:00:01 2026 UTC