[PHP-DEV] Re: [PATCH] [Fwd: [PHP-DEV] PHP 4.0 Bug #4067: Fails to compile with EasySoft ODBC Bridge] From: Sandino Araico Sánchez (sandino <email protected>)
Date: 04/10/00

> php_odbc.c: In function `php_if_odbc_execute':
> php_odbc.c:849: parse error before `FAR'
> php_odbc.c:852: parse error before `FAR'
> make[3]: *** [php_odbc.lo] Error 1
> make[3]: Leaving directory `/usr/local/src/php-4.0RC1/ext/odbc'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/usr/local/src/php-4.0RC1/ext/odbc'
> make[1]: *** [all] Error 1
> make[1]: Leaving directory `/usr/local/src/php-4.0RC1/ext'
> make: *** [all-recursive] Error 1
>
> I'm not sure what went wrong. Like I said, I've been using this type of setup for quite some
> time and the release candidate is the first time I've had any problems.
>
> Any help you can give would be greatly appreciated. I'm running RedHat 6.1 on Intel box,
> apache 1.3.12, ODBC-ODBCBridge Client 1.0.0.6.
>
>

This one worked for me.
It's against 4.0RC1

--- php-4.0RC1-orig/ext/odbc/php_odbc.c Mon Mar 13 23:15:33 2000
+++ php-4.0RC1/ext/odbc/php_odbc.c Fri Apr 7 11:17:43 2000
@@ -846,10 +846,19 @@
   char buf[4096];
   int fp, nbytes;
   while(rc == SQL_NEED_DATA) {
- rc = SQLParamData(result->stmt, (PTR FAR *)&fp);
+/* The reported errors were parse error before FAR on both SQLParamData and
+ * SQLPutData; so I replaced them with the correct types from
+ * /usr/local/easysoft/oob/client/include/sql.h on lines 754 and 759
+ */
+
+ /*rc = SQLParamData(result->stmt, (PTR FAR *)&fp);*/
+ /* oob uses SQLPOINTER instead of (PTR FAR *) in SQLParamData */
+ rc = SQLParamData(result->stmt, (SQLPOINTER *)&fp);
    if (rc == SQL_NEED_DATA) {
     while((nbytes = read(fp, &buf, 4096)) > 0)
- SQLPutData(result->stmt,(UCHAR FAR*) &buf, nbytes);
+ /*SQLPutData(result->stmt,(UCHAR FAR*) &buf, nbytes);*/
+ /* oob uses SQLPOINTER instead of (UCHAR FAR *) in SQLPutData */
+ SQLPutData(result->stmt, (SQLPOINTER)&buf, nbytes);
    }
   }
  } else {

--
Sandino Araico Sánchez.
En realidad el bien y al mal no son tan importantes.

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>