Przeglądaj źródła

Make function pointers consistently use typedefs

Annoyingly, 'using' doesn't support calling conventions.

The next commit changes things to use reinterpret_cast, so instead
of having to use a pointer for one and not the other, we'll remove
the need to use pointer notation for both.
nosoop 1 rok temu
rodzic
commit
06b69b670c
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      mmsplugin.cpp

+ 2 - 2
mmsplugin.cpp

@@ -66,8 +66,8 @@ static_assert(sizeof(CEconItemAttributeDefinition) + 0x14 == 0x58, "CEconItemAtt
 using AttributeMap = CUtlMap<int, CEconItemAttributeDefinition, int>;
 AttributeMap *g_SchemaAttributes;
 
-using GetEconItemSchemaFn_t = uintptr_t();
-GetEconItemSchemaFn_t *fnGetEconItemSchema = nullptr;
+typedef uintptr_t (*GetEconItemSchema_fn)(void);
+GetEconItemSchema_fn fnGetEconItemSchema = nullptr;
 
 // https://www.unknowncheats.me/wiki/Calling_Functions_From_Injected_Library_Using_Function_Pointers_in_C%2B%2B
 #ifdef WIN32