diff --git a/base/components/parser.cpp b/base/components/parser.cpp index a1905a4..a68f682 100644 --- a/base/components/parser.cpp +++ b/base/components/parser.cpp @@ -2045,9 +2045,12 @@ Token parse_identifier( bool* possible_member_function ) Token name = currtok; _ctx->parser.Scope->Name = name.Text; + Macro* macro = lookup_macro(currtok.Text); + b32 accept_as_identifier = macro && bitfield_is_set(MacroFlags, macro->Flags, MF_Allow_As_Identifier ); + // Typename can be: '::' // If that is the case first option will be Tok_Access_StaticSymbol below - if (check(Tok_Identifier)) + if (check(Tok_Identifier) || accept_as_identifier) eat( Tok_Identifier ); // diff --git a/base/dependencies/macros.hpp b/base/dependencies/macros.hpp index 2c3c55a..7ca0d77 100644 --- a/base/dependencies/macros.hpp +++ b/base/dependencies/macros.hpp @@ -25,8 +25,12 @@ #endif #endif // GEN_API -#ifndef global -#define global static // Global variables +#ifndef global // Global variables +# ifdef GEN_DYN_EXPORT +# define global +# else +# define global static +# endif #endif #ifndef internal #define internal static // Internal linkage diff --git a/scripts/build.ci.ps1 b/scripts/build.ci.ps1 index 8dfea77..507b3b1 100644 --- a/scripts/build.ci.ps1 +++ b/scripts/build.ci.ps1 @@ -280,6 +280,7 @@ if ( $c_lib_dyn ) $compiler_args += $flag_c11 $compiler_args += ( $flag_define + 'GEN_DYN_LINK' ) $compiler_args += ( $flag_define + 'GEN_DYN_EXPORT' ) + $compiler_args += ( $flag_define + 'GEN_DEFINE_LIBRARY_CODE_CONSTANTS' ) $linker_args = @() $result = build-simple $path_build $includes $compiler_args $linker_args $unit $path_dll