#ifdef WIN32
-#ifdef _MSC_VER
-#pragma comment(lib, "sdl.lib")
-#pragma comment(lib, "sdlmain.lib")
-#endif
#include <io.h>
#include "conio.h"
#else
#include <SDL.h>
+#ifdef WIN32
+#ifdef _MSC_VER
+#if SDL_MAJOR_VERSION == 1
+#pragma comment(lib, "sdl.lib")
+#pragma comment(lib, "sdlmain.lib")
+#else
+#pragma comment(lib, "sdl2.lib")
+#pragma comment(lib, "sdl2main.lib")
+#endif
+#endif
+#endif
+
#include "quakedef.h"
// =======================================================================