UCHAR: #define, typedef, and __stdcall in win.h (lcc-win32)

  • Follow


/* I found this problem when compiling a single source file from
 * the current Tcl source (8.5.2):
 * lcc-win32 (version 3.8) reports an error with respect to its
 * own win.h header file if a UCHAR macro is defined before
 * inclusion of win.h.
 * The problem is demonstrated in the following short example:
 */

#define UCHAR(c) ((unsigned char) (c))
typedef unsigned char UCHAR;

UCHAR __stdcall a(void);

int main(void) { return 0; }


/* The error message is:
 *
 * | Error testit.c: 4  Syntax error; missing semicolon before  `a'
 * | Warning testit.c: 4  no type specified. Defaulting to int
 * | 1 error, 1 warning
 *
 * The same example compiles without problems with the
 * Visual C++ compiler.
 * 
 * Originally, the problem occured in line 14989 of
 * ...\lcc\include\win.h, i.e. in the line:
 *
 *   UCHAR APIENTRY Netbios(PNCB);
 *
 *
 * Olaf
 */
0
Reply odt 5/29/2008 7:13:24 AM

Olaf Dietrich wrote:
> /* I found this problem when compiling a single source file from
>  * the current Tcl source (8.5.2):
>  * lcc-win32 (version 3.8) reports an error with respect to its
>  * own win.h header file if a UCHAR macro is defined before
>  * inclusion of win.h.
>  * The problem is demonstrated in the following short example:
>  */
> 
> #define UCHAR(c) ((unsigned char) (c))
> typedef unsigned char UCHAR;
> 
> UCHAR __stdcall a(void);
> 
> int main(void) { return 0; }
> 
> 
> /* The error message is:
>  *
>  * | Error testit.c: 4  Syntax error; missing semicolon before  `a'
>  * | Warning testit.c: 4  no type specified. Defaulting to int
>  * | 1 error, 1 warning
>  *
>  * The same example compiles without problems with the
>  * Visual C++ compiler.
>  * 
>  * Originally, the problem occured in line 14989 of
>  * ...\lcc\include\win.h, i.e. in the line:
>  *
>  *   UCHAR APIENTRY Netbios(PNCB);
>  *
>  *
>  * Olaf
>  */

Hi Olaf

Just try writing _stdcall instead of __stdcall.

I think I should support both _stdcall and __stdcall but...
haven't done it yet.



-- 
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
0
Reply jacob 5/29/2008 12:26:11 PM


1 Replies
124 Views

(page loaded in 0.061 seconds)

Similiar Articles:




7/14/2012 9:54:38 PM


Reply: