Bug 43827 - Oracle dbd driver int_errorcode macro invalid with VC++
Summary: Oracle dbd driver int_errorcode macro invalid with VC++
Status: RESOLVED FIXED
Alias: None
Product: APR
Classification: Unclassified
Component: APR-util (show other bugs)
Version: HEAD
Hardware: Other Windows 2000
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2007-11-09 08:23 UTC by Tom Donovan
Modified: 2007-11-12 13:06 UTC (History)
0 users



Attachments
apr_dbd_oracle VC patch (2.43 KB, patch)
2007-11-09 08:23 UTC, Tom Donovan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Donovan 2007-11-09 08:23:16 UTC
The int_errorcode macro in apr_dbd_oracle.c gives errors with Visual C++ when
DEBUG is not defined:

  error C2143: syntax error : missing ';' before 'type'

Attached patch changes macro to include the semicolon, so nothing is generated
if DEBUG is undefined.  Renames macro to INT_ERRORCODE insted of int_errorcode.
Comment 1 Tom Donovan 2007-11-09 08:23:57 UTC
Created attachment 21105 [details]
apr_dbd_oracle VC patch
Comment 2 Bojan Smojver 2007-11-11 23:35:13 UTC
Can you see if r594036 compiles for you?
Comment 3 Tom Donovan 2007-11-12 06:34:45 UTC
Yes, it compiles fine now.

Also tested the driver with Oracle 10.2.0 (Express Edition).  Works OK.

Apparently the bare ";" line is OK as an executable statement, but not as a
declaration.  I didn't think of that...
Comment 4 Bojan Smojver 2007-11-12 13:06:50 UTC
Yeah, the "problem" is that VC++ strictly enforces that declarations go before
anything else. So, when this null statement becomes intermixed with
declarations, VC++ correctly complains.