Ticket #3138: sdl2.0.4-win-fixes.patch

File sdl2.0.4-win-fixes.patch, 2.4 KB (added by historic_bruno, 9 years ago)
  • build/premake/premake4.lua

     
    13191319    -- note that the header isn't actually precompiled here, only #included
    13201320    -- so that the build stage can use it as a precompiled header.
    13211321    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"
    13221324    lcxxtestrootoptions = lcxxtestrootoptions .. include
    13231325    lcxxtestoptions = lcxxtestoptions .. include
    13241326
  • source/lib/sysdep/os/win/wseh.cpp

     
    1 /* Copyright (c) 2010 Wildfire Games
     1/* Copyright (c) 2015 Wildfire Games
    22 *
    33 * Permission is hereby granted, free of charge, to any person obtaining
    44 * a copy of this software and associated documentation files (the
     
    3434#include "lib/sysdep/os/win/wutil.h"
    3535#include "lib/sysdep/os/win/wdbg_sym.h"         // wdbg_sym_WriteMinidump
    3636
    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
    4139
    4240// note: several excellent references are pointed to by comments below.
    4341
     
    355353
    356354#include "lib/utf8.h"
    357355
    358 // disable argument conversion on ICC because it says "nonstandard second parameter "__wchar_t *[]" of "main"" and
    359 // "unresolved external symbol _wmain referenced in function ___tmainCRTStartup" (extern "C" { and __cdecl don't help)
    360 #if ICC_VERSION
    361 #define MAIN_STARTUP mainCRTStartup
    362 
    363 #else
    364356#define MAIN_STARTUP wmainCRTStartup
    365357
    366 EXTERN_C int main(int argc, char* argv[]);
    367 
    368 // required because main's argv is in a non-UTF8 encoding
    369 int wmain(int argc, wchar_t* argv[])
    370 {
    371     if(argc == 0)
    372         return EXIT_FAILURE;    // ensure &utf8_argv[0] is safe
    373     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 #endif
    388 
    389358EXTERN_C int MAIN_STARTUP();
    390359
    391360static int CallStartupWithinTryBlock()