main.cpp 417 B

1234567891011121314151617181920212223
  1. #include "StdInc.h"
  2. #include "VCAI.h"
  3. #ifdef __GNUC__
  4. #define strcpy_s(a, b, c) strncpy(a, c, b)
  5. #endif
  6. const char *g_cszAiName = "VCAI";
  7. extern "C" DLL_EXPORT int GetGlobalAiVersion()
  8. {
  9. return AI_INTERFACE_VER;
  10. }
  11. extern "C" DLL_EXPORT void GetAiName(char* name)
  12. {
  13. strcpy_s(name, strlen(g_cszAiName) + 1, g_cszAiName);
  14. }
  15. extern "C" DLL_EXPORT CGlobalAI* GetNewAI()
  16. {
  17. return new VCAI();
  18. }