Changeset 2274 for trunk/src/core.h


Ignore:
Timestamp:
Jan 25, 2013, 1:35:24 PM (9 years ago)
Author:
sam
Message:

build: provide weak symbols for lol_sdl_main on Visual Studio.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core.h

    r2273 r2274  
    7070
    7171/* If using SDL, let it override main() but immediately replace
    72  * the override with ours. */
     72 * the override with ours, then declare weak symbols to ensure one
     73 * of our dummy functions gets replaced by the user's main(). */
    7374#if defined USE_SDL
    7475#   include <SDL_main.h>
     
    7677#       undef main
    7778#       define main lol_sdl_main
     79#       if defined _MSC_VER
     80int lol_sdl_main();
     81int lol_sdl_main_msvc();
     82#pragma comment(linker, "/alternatename:?lol_sdl_main@@YAHXZ" \
     83                                      "=?lol_sdl_main_msvc@@YAHXZ")
     84int lol_sdl_main(int argc, char **argv);
     85int lol_sdl_main_msvc(int argc, char **argv);
     86#pragma comment(linker, "/alternatename:?lol_sdl_main@@YAHHPEAPEAD@Z" \
     87                                      "=?lol_sdl_main_msvc@@YAHHPEAPEAD@Z")
     88int lol_sdl_main(int argc, char **argv, char **envp);
     89int lol_sdl_main_msvc(int argc, char **argv, char **envp);
     90#pragma comment(linker, "/alternatename:?lol_sdl_main@@YAHHPEAPEAD0@Z" \
     91                                      "=?lol_sdl_main_msvc@@YAHHPEAPEAD0@Z")
     92#       endif
    7893#   endif
    7994#endif
Note: See TracChangeset for help on using the changeset viewer.