Fix build in Visual Studio (2013)

Tested with Visual Studio 2013.
This commit is contained in:
chosenofbear 2015-06-17 09:12:19 -04:00
parent 6380a93cec
commit c375d27daa
22 changed files with 58 additions and 10 deletions

View file

@ -19,6 +19,7 @@
** along with mkxp. If not, see <http://www.gnu.org/licenses/>.
*/
#include "crossplatform.h"
#include "alstream.h"
#include "sharedstate.h"

7
src/crossplatform.h Normal file
View file

@ -0,0 +1,7 @@
#ifdef _MSC_VER
#define snprintf _snprintf
#include <direct.h>
#define chdir _chdir
#endif

View file

@ -19,6 +19,7 @@
** along with mkxp. If not, see <http://www.gnu.org/licenses/>.
*/
#include "crossplatform.h"
#include "eventthread.h"
#include <SDL_events.h>

View file

@ -22,6 +22,9 @@
#ifndef EXCEPTION_H
#define EXCEPTION_H
#ifdef _MSC_VER
#define _CRT_SECURE_NO_DEPRECATE
#endif
#include <string>
#include <stdio.h>
#include <stdarg.h>

View file

@ -19,6 +19,7 @@
** along with mkxp. If not, see <http://www.gnu.org/licenses/>.
*/
#include "crossplatform.h"
#include "filesystem.h"
#include "rgssad.h"

View file

@ -43,7 +43,9 @@
#include <SDL_image.h>
#include <time.h>
#ifndef _MSC_VER
#include <sys/time.h>
#endif
#include <errno.h>
#include <algorithm>

View file

@ -19,6 +19,7 @@
** along with mkxp. If not, see <http://www.gnu.org/licenses/>.
*/
#include "crossplatform.h"
#include "keybindings.h"
#include "config.h"

View file

@ -26,11 +26,14 @@
#include <SDL_ttf.h>
#include <SDL_sound.h>
#ifndef _MSC_VER
#include <unistd.h>
#endif
#include <string.h>
#include <assert.h>
#include <string>
#include "crossplatform.h"
#include "sharedstate.h"
#include "eventthread.h"
#include "gl-debug.h"
@ -357,4 +360,4 @@ int main(int argc, char *argv[])
SDL_Quit();
return 0;
}
}

View file

@ -44,7 +44,11 @@ int __sdlThreadFun(void *obj)
template<class C, void (C::*func)()>
SDL_Thread *createSDLThread(C *obj, const std::string &name = std::string())
{
#ifdef _MSC_VER
return SDL_CreateThread((__sdlThreadFun<C, func>), name.c_str(), obj);
#else
return SDL_CreateThread(__sdlThreadFun<C, func>, name.c_str(), obj);
#endif
}
/* On Android, SDL_RWFromFile always opens files from inside

View file

@ -19,6 +19,7 @@
** along with mkxp. If not, see <http://www.gnu.org/licenses/>.
*/
#include "crossplatform.h"
#include "settingsmenu.h"
#include <SDL_video.h>

View file

@ -38,7 +38,9 @@
#include "exception.h"
#include "sharedmidistate.h"
#ifndef _MSC_VER
#include <unistd.h>
#endif
#include <stdio.h>
#include <string>

View file

@ -19,6 +19,7 @@
** along with mkxp. If not, see <http://www.gnu.org/licenses/>.
*/
#include "crossplatform.h"
#include "soundemitter.h"
#include "sharedstate.h"

View file

@ -22,6 +22,9 @@
#ifndef UTIL_H
#define UTIL_H
#ifdef _MSC_VER
#define _CRT_SECURE_NO_DEPRECATE
#endif
#include <stdio.h>
#include <string>
#include <algorithm>

View file

@ -19,6 +19,9 @@
** along with mkxp. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef _MSC_VER
#include <algorithm>
#endif
#include "aldatasource.h"
#include "exception.h"