msext token with different type between windows and linux
Issue #58
resolved
The tokens found with getTokens don't correctly manage microsoft specific tokens, like __stdcall.
For the same token value (tokenValue) __stdcall, on windows, the type (tokenType) is 'msext_stdcall', but is identifier on linux.
With the following code:
set tokenSearch {
msext_int8
msext_int16
msext_int32
msext_int64
msext_based
msext_declspec
msext_cdecl
msext_fastcall
msext_stdcall
msext_try
msext_except
msext_finally
msext_leave
msext_inline
msext_asm
msext_region
msext_endregion
}
proc processFile {f} {
set tokens [getTokens $f 1 0 -1 -1 $tokenSearch]
set index 0
set end [llength $tokens]
# Parse the file's tokens
while {$index < $end} {
set token [lindex $tokens $index]
set tokenValue [lindex $token 0]
set tokenType [lindex $token 3]
And the parsed code is the following:
#if owSystemWin32
int __stdcall WinMain(HINSTANCE _hInstance, HINSTANCE _hPrevInstance, LPSTR _lpCmdLine, int _nCmdShow)
{
return 0;
}
#else
int main(int _argc, char const **_argv)
{
return 0;
}
#endif
Comments (4)
-
-
build boost in an external project - see
#58→ <<cset 1d4700f9a2da>>
-
- changed status to resolved
msext token are there also on non windows platforms - fix
#58→ <<cset 18a832666647>>
-
It seems we may be able to have this flag without recompiling boost.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=789329
I will try and report.
- Log in to comment
__stdcall
is indeed anidentifier
on linux/mac. Unfortunately this behavior is hardcoded in the boost wave library by BOOST_WAVE_SUPPORT_MS_EXTENSIONS - see http://www.boost.org/doc/libs/1_57_0/boost/wave/wave_config.hpp - and is used when building the boost wave library, so it can't be changed when using boost wave in vera++.Our best option might be to build boost wave within vera++…