File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -119,10 +119,20 @@ void reshadefx::preprocessor::add_include_path(const std::filesystem::path &path
119
119
assert (!path.empty ());
120
120
_include_paths.push_back (path);
121
121
}
122
- bool reshadefx::preprocessor::add_macro_definition (const std::string &name, const macro ¯o )
122
+ bool reshadefx::preprocessor::add_macro_definition (const std::string &name, const macro &new_macro )
123
123
{
124
124
assert (!name.empty ());
125
- return _macros.emplace (name, macro).second ;
125
+ const auto insert = _macros.emplace (name, new_macro);
126
+ if (insert.second )
127
+ return true ;
128
+ // Allow redefinition of identical macros
129
+ const macro &existing_macro = insert.first ->second ;
130
+ return
131
+ existing_macro.replacement_list == new_macro.replacement_list &&
132
+ existing_macro.parameters == new_macro.parameters &&
133
+ existing_macro.is_predefined == new_macro.is_predefined &&
134
+ existing_macro.is_variadic == new_macro.is_variadic &&
135
+ existing_macro.is_function_like == new_macro.is_function_like ;
126
136
}
127
137
128
138
bool reshadefx::preprocessor::append_file (const std::filesystem::path &path)
You can’t perform that action at this time.
0 commit comments