Ticket #3138: sdl2.0.4-win-fixes.patch
File sdl2.0.4-win-fixes.patch, 2.4 KB (added by , 9 years ago) |
---|
-
build/premake/premake4.lua
1319 1319 -- note that the header isn't actually precompiled here, only #included 1320 1320 -- so that the build stage can use it as a precompiled header. 1321 1321 local include = " --include=precompiled.h" 1322 -- This is required to build against SDL 2.0.4 on Windows 1323 include = include .. " --include=lib/external_libraries/libsdl.h" 1322 1324 lcxxtestrootoptions = lcxxtestrootoptions .. include 1323 1325 lcxxtestoptions = lcxxtestoptions .. include 1324 1326 -
source/lib/sysdep/os/win/wseh.cpp
1 /* Copyright (c) 201 0Wildfire Games1 /* Copyright (c) 2015 Wildfire Games 2 2 * 3 3 * Permission is hereby granted, free of charge, to any person obtaining 4 4 * a copy of this software and associated documentation files (the … … 34 34 #include "lib/sysdep/os/win/wutil.h" 35 35 #include "lib/sysdep/os/win/wdbg_sym.h" // wdbg_sym_WriteMinidump 36 36 37 #if MSC_VERSION >= 1400 38 # include <process.h> // __security_init_cookie 39 # define NEED_COOKIE_INIT 40 #endif 37 #include <process.h> // __security_init_cookie 38 #define NEED_COOKIE_INIT 41 39 42 40 // note: several excellent references are pointed to by comments below. 43 41 … … 355 353 356 354 #include "lib/utf8.h" 357 355 358 // disable argument conversion on ICC because it says "nonstandard second parameter "__wchar_t *[]" of "main"" and359 // "unresolved external symbol _wmain referenced in function ___tmainCRTStartup" (extern "C" { and __cdecl don't help)360 #if ICC_VERSION361 #define MAIN_STARTUP mainCRTStartup362 363 #else364 356 #define MAIN_STARTUP wmainCRTStartup 365 357 366 EXTERN_C int main(int argc, char* argv[]);367 368 // required because main's argv is in a non-UTF8 encoding369 int wmain(int argc, wchar_t* argv[])370 {371 if(argc == 0)372 return EXIT_FAILURE; // ensure &utf8_argv[0] is safe373 std::vector<char*> utf8_argv(argc);374 for(int i = 0; i < argc; i++)375 {376 std::string utf8 = utf8_from_wstring(argv[i]);377 utf8_argv[i] = strdup(utf8.c_str());378 }379 380 const int ret = main(argc, &utf8_argv[0]);381 382 for(int i = 0; i < argc; i++)383 free(utf8_argv[i]);384 return ret;385 }386 387 #endif388 389 358 EXTERN_C int MAIN_STARTUP(); 390 359 391 360 static int CallStartupWithinTryBlock()