[freetds] anyone using freetds with PHP ?
Lowden, James K
LowdenJK at bernstein.com
Thu Jan 15 09:47:11 EST 2004
> From: John P. Looney [mailto:valen at tuatha.org]
> Sent: January 15, 2004 7:21 AM
>
> The only thing that worries me is that I changed the PHP
> code slightly,
> to get it to compile:
...
> I changed:
> dbsetmaxprocs((SHORT)MS_SQL_G(max_procs));
> to
> dbsetmaxprocs((int)MS_SQL_G(max_procs));
> And it did compile. Can anyone help ?
I'd look into why SHORT isn't defined.
$ grep -n SHORT include/sybdb.h |grep typedef
117:typedef short SHORT;
118:typedef unsigned short USHORT;
I've never compiled PHP, but I would expect that it needs to use our sybdb.h
if it's to employ the mssql extension.
Your change is probably wrong, because sizeof(SHORT) != sizeof(int) on most
machines, including i386. But it also looks harmless to me, because
dbsetmaxprocs() accepts a SHORT parameter (which is weird). The compiler
can't pass 32 bits in a 16-bit argument, and the cast won't change the
low-order bits.
Unless MS_SQL_G() returns -1 or zero. In that case, our dbsetmaxprocs()
should return FAIL, but doesn't check. That would be worth fixing.
--jkl
-----------------------------------------
The information contained in this transmission may contain privileged and confidential information and is intended only for the use of the person(s) named above. If you are not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender immediately by reply e-mail and destroy all copies of the original message. Please note that we do not accept account orders and/or instructions by e-mail, and therefore will not be responsible for carrying out such orders and/or instructions.
More information about the FreeTDS
mailing list