Win32api Error: Syntax error VC\INCLUDE\excpt.h(64)

Hi all. I try to compile lib/win32api. Therefore I executed:

[code]move %cintsysdir%\include\windows.h %cintsysdir%\include_windows.h
move %cintsysdir%\include\winsock.h %cintsysdir%\include_winsock.h

makecint -mk Makewin -dl win32api.dll -h +P cintwin.h -P winfunc.h -cint -Z0[/code]

But the build process stops with a syntax error, here is the log:

/cygdrive/c/Users/Lis/Documents/work/cint-svn-ori/bin/cint.exe -K -w2 -zwin32api -nG__c_win32api.c -D__MAKECINT__ -DG__MAKECINT -DG__REDIRECTIO -DG__SHAREDLIB -DG__WIN32 -DWIN32 -D_WIN32 -DG__NEWSTDHEADER -D_CRT_SECURE_NO_DEPRECATE=1 -DG__HAVE_CONFIG -DG__NOMAKEINFO -c-2 -IC:/Users/Lis/Documents/work/cint-svn-ori/cint/inc -DG__REDIRECTIO -DG__SHAREDLIB -DG__WIN32 -DWIN32 -D_WIN32 -DG__NEWSTDHEADER -D_CRT_SECURE_NO_DEPRECATE=1 -DG__HAVE_CONFIG -DG__NOMAKEINFO -Z0 +P cintwin.h -P winfunc.h 2676015_cint.c C:\Program Files\Microsoft SDKs\Windows\v6.1\include\windef.h(124) : warning C4005: 'WINAPI' : macro redefinition C:/Users/Lis/Documents/work/cint-svn-ori/cint/include\platform.h(42) : see previous definition of 'WINAPI' C:\Program Files\Microsoft SDKs\Windows\v6.1\include\windef.h(126) : warning C4005: 'APIENTRY' : macro redefinition C:/Users/Lis/Documents/work/cint-svn-ori/cint/include\platform.h(48) : see previous definition of 'APIENTRY' C:\Program Files\Microsoft SDKs\Windows\v6.1\include\winnt.h(287) : warning C4005: 'NTAPI' : macro redefinition C:/Users/Lis/Documents/work/cint-svn-ori/cint/include\platform.h(39) : see previous definition of 'NTAPI' C:\Program Files\Microsoft SDKs\Windows\v6.1\include\wingdi.h(23) : warning C4005: 'WINGDIAPI' : macro redefinition C:/Users/Lis/Documents/work/cint-svn-ori/cint/include\platform.h(45) : see previous definition of 'WINGDIAPI' Warning: Unknown type SA_Parameter in function argument c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(69) Warning: Unknown type SA_Parameter|SA_ReturnValue in function argument c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(100) Warning: Unknown type SA_Parameter in function argument c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(131) Warning: Unknown type SA_ReturnValue in function argument c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(143) Warning: Unknown type SA_Method in function argument c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(153) Warning: Unknown type SA_Parameter in function argument c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(164) Warning: Unknown type SA_Parameter|SA_ReturnValue in function argument c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(174) Warning: Unknown type SA_Parameter in function argument c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(184) Warning: Unknown type SA_Parameter|SA_ReturnValue in function argument c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(196) Error: Syntax error C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\excpt.h(64) !!!Removing G__c_win32api.c G__c_win32api.h !!! make: *** [G__c_win32api.c] Error 1

Has someone a idea what could cause this error?
Thanks Louis

Ok I solved the error above. If I run makecint with:

But now the resulting win32api.dll is only 7kb in size. Compilation log:

/cygdrive/c/Users/Lis/Documents/work/cint-svn-ori/bin/cint.exe -K -w2 -zwin32api -nG__c_win32api.c -D__MAKECINT__ -DG__MAKECINT -DG__REDIRECTIO -DG__SHAREDLIB -DG__WIN32 -DWIN32 -D_WIN32 -DG__NEWSTDHEADER -D_CRT_SECURE_NO_DEPRECATE=1 -DG__HAVE_CONFIG -DG__NOMAKEINFO -D_MSC_VER=1100 -c-2 -IC:/Users/Lis/Documents/work/cint-svn-ori/cint/inc -DG__REDIRECTIO -DG__SHAREDLIB -DG__WIN32 -DWIN32 -D_WIN32 -DG__NEWSTDHEADER -D_CRT_SECURE_NO_DEPRECATE=1 -DG__HAVE_CONFIG -DG__NOMAKEINFO -D_MSC_VER=1100 -Z0 +P cintwin.h 249215_cint.c C:\Program Files\Microsoft SDKs\Windows\v6.1\include\windef.h(124) : warning C4005: 'WINAPI' : macro redefinition C:/Users/Lis/Documents/work/cint-svn-ori/cint/include\platform.h(42) : see previous definition of 'WINAPI' C:\Program Files\Microsoft SDKs\Windows\v6.1\include\windef.h(126) : warning C4005: 'APIENTRY' : macro redefinition C:/Users/Lis/Documents/work/cint-svn-ori/cint/include\platform.h(48) : see previous definition of 'APIENTRY' C:\Program Files\Microsoft SDKs\Windows\v6.1\include\winnt.h(287) : warning C4005: 'NTAPI' : macro redefinition C:/Users/Lis/Documents/work/cint-svn-ori/cint/include\platform.h(39) : see previous definition of 'NTAPI' C:\Program Files\Microsoft SDKs\Windows\v6.1\include\wingdi.h(23) : warning C4005: 'WINGDIAPI' : macro redefinition C:/Users/Lis/Documents/work/cint-svn-ori/cint/include\platform.h(45) : see previous definition of 'WINGDIAPI' Note: Bit-field not accessible from interpreter C:\Program Files\Microsoft SDKs\Windows\v6.1\include\winnt.h(3910) Warning: Unknown type 'PULONG64' in function argument handled as int C:\Program Files\Microsoft SDKs\Windows\v6.1\include\winbase.h(2847) Warning: Unknown type 'PULONG64' in function argument handled as int C:\Program Files\Microsoft SDKs\Windows\v6.1\include\winbase.h(2855) Warning: Unknown type 'PULONG64' in function argument handled as int C:\Program Files\Microsoft SDKs\Windows\v6.1\include\winbase.h(2863) cl -IC:/Users/Lis/Documents/work/cint-svn-ori/cint/inc -DG__REDIRECTIO -DG__SHAREDLIB -DG__WIN32 -DWIN32 -D_WIN32 -DG__NEWSTDHEADER -D_CRT_SECURE_NO_DEPRECATE=1 -DG__HAVE_CONFIG -DG__NOMAKEINFO -D_MSC_VER=1100 -O2 -MD -nologo -wd4996 -EHs -c G__c_win32api.c G__c_win32api.c link -nologo -ignore:4049 -ignore:4217 -ignore:4221 -incremental:no -DLL -implib:win32api.lib -out:win32api.dll G__c_win32api.obj -LIBPATH:"C:/Users/Lis/Documents/work/cint-svn-ori/lib" libCint.lib kernel32.lib user32.lib Creating library win32api.lib and object win32api.exp

If I try to run a programm which uses win32api functions I do get this error:

C:\Users\Lis\Documents\work\cint_learn>cint.exe -IC:\cint\main -IC:\cint\inc -IC :\cint\include -IC:\cint\stl socksrv.c #error win32api.dll is not ready. Run 'setup.bat' in %CINTSYSDIR%\lib\win32api d irectory if you use WinNT/95.

Is it somehow possible to disable inclusion of a include file?

Thanks Louis

I fixed it.
Run makecint with:

And create the file excpt.h in lib/win32api

[code]#if _MSC_VER > 1000
#pragma once
#endif

#ifndef _INC_EXCPT
#define _INC_EXCPT
#include <crtdefs.h>
#ifdef _MSC_VER
#pragma pack(push,_CRT_PACKING)
#endif

#ifdef __cplusplus
extern ā€œCā€ {
#endif
typedef enum _EXCEPTION_DISPOSITION {
ExceptionContinueExecution,
ExceptionContinueSearch,
ExceptionNestedException,
ExceptionCollidedUnwind
} EXCEPTION_DISPOSITION;
#ifdef _MSC_VER

#define GetExceptionCode _exception_code
#define exception_code _exception_code
#define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
#define exception_info (struct _EXCEPTION_POINTERS *)_exception_info
#define AbnormalTermination _abnormal_termination
#define abnormal_termination _abnormal_termination

unsigned long __cdecl _exception_code(void);
void * __cdecl _exception_info(void);
int __cdecl _abnormal_termination(void);

#endif

#define EXCEPTION_EXECUTE_HANDLER 1
#define EXCEPTION_CONTINUE_SEARCH 0
#define EXCEPTION_CONTINUE_EXECUTION -1

#ifdef __cplusplus
}
#endif

#ifdef _MSC_VER
#pragma pack(pop)
#endif /* _MSC_VER */

#endif /* _INC_EXCPT */
[/code]

Then type

Hi Louis,

Your update has been uploaded to svn (revision 30250).

Thanks,
Philippe.

Thanks again. But could you also add this to cint7?

Greets Louis

Hi Louis,

See root.cern.ch/phpBB2/viewtopic.php?t=9497

Cheers,
Philippe.