Updated gencpp with latest fixes used in other projects.

This variant can support parsing some Unreal Engine files!!
This commit is contained in:
2024-04-17 17:40:32 -04:00
parent 83d691c65c
commit 36260f6edb
17 changed files with 1281 additions and 579 deletions

View File

@ -73,22 +73,22 @@ namespace ESpecifier
{ sizeof( "= 0" ), "= 0" },
{ sizeof( "volatile" ), "volatile" },
};
return lookup[ type ];
return lookup[type];
}
Type to_type( StrC str )
{
local_persist u32 keymap[ NumSpecifiers ];
local_persist u32 keymap[NumSpecifiers];
do_once_start for ( u32 index = 0; index < NumSpecifiers; index++ )
{
StrC enum_str = to_str( ( Type )index );
keymap[ index ] = crc32( enum_str.Ptr, enum_str.Len - 1 );
StrC enum_str = to_str( (Type)index );
keymap[index] = crc32( enum_str.Ptr, enum_str.Len - 1 );
}
do_once_end u32 hash = crc32( str.Ptr, str.Len );
for ( u32 index = 0; index < NumSpecifiers; index++ )
{
if ( keymap[ index ] == hash )
return ( Type )index;
if ( keymap[index] == hash )
return (Type)index;
}
return Invalid;
}