MSVC Cleanup

This commit is contained in:
scribam 2020-04-22 23:27:57 +02:00
parent 0b9ecd35c6
commit 0b1d739673
8 changed files with 12 additions and 90 deletions

View File

@ -153,12 +153,6 @@
#define CPU_ARM64 0x20000008
#define CPU_MIPS64 0x20000009
//BUILD_COMPILER
#define COMPILER_VC 0x30000001
#define COMPILER_GCC 0x30000002
#define COMPILER_CLANG 0x30000003
#define COMPILER_INTEL 0x30000004
//FEAT_SHREC, FEAT_AREC, FEAT_DSPREC
#define DYNAREC_NONE 0x40000001
#define DYNAREC_JIT 0x40000002
@ -177,12 +171,6 @@
#endif
#endif
#ifdef __GNUC__
#define BUILD_COMPILER COMPILER_GCC
#else
#define BUILD_COMPILER COMPILER_VC
#endif
//Targets
#if defined(TARGET_WIN86)
#define HOST_OS OS_WINDOWS
@ -301,8 +289,6 @@
// Compiler Related
#define COMPILER_VC_OR_CLANG_WIN32 ((BUILD_COMPILER == COMPILER_VC) || (BUILD_COMPILER == COMPILER_CLANG) && HOST_OS == OS_WINDOWS)
#ifndef _MSC_VER
#define ATTR_USED __attribute__((used))
#define ATTR_UNUSED __attribute__((used))

View File

@ -4,8 +4,6 @@
Works surprisingly well considering how old it is ...
*/
#define _CRT_SECURE_NO_DEPRECATE (1)
#include "cfg.h"
#include "ini.h"
#include "stdclass.h"

View File

@ -18,15 +18,14 @@
You should have received a copy of the GNU General Public License
along with reicast. If not, see <https://www.gnu.org/licenses/>.
*/
#include "types.h"
#if !defined(_MSC_VER)
#if !defined(_MSC_VER) && (BUILD_COMPILER!=COMPILER_CLANG || !defined(WIN32))
#include "types.h"
#include "network/net_platform.h"
#include <cstdio>
#include <cerrno>
#include "network/net_platform.h"
extern "C" {
#include <pico_stack.h>
#include <pico_ipv4.h>
@ -150,4 +149,4 @@ char *read_name(char *reader, char *buffer, int *count)
return name;
}
#endif // !COMPILER_VC_OR_CLANG_WIN32
#endif

View File

@ -55,10 +55,6 @@ cThread emu_thread(&dc_run, NULL);
static std::future<void> loading_done;
std::atomic<bool> loading_canceled;
#ifdef _WIN32
#include <windows.h>
#endif
static s32 plugins_Init()
{

View File

@ -12,12 +12,15 @@
#include <mach/mach.h>
#endif
#if COMPILER_VC_OR_CLANG_WIN32
#ifdef _WIN32
#include <algorithm>
#include <io.h>
#include <direct.h>
#define access _access
#define R_OK 4
#ifndef R_OK
#define R_OK 4
#endif
#define mkdir(dir, mode) _mkdir(dir)
#else
#include <unistd.h>
#endif
@ -147,15 +150,7 @@ std::string get_game_dir()
bool make_directory(const std::string& path)
{
#if COMPILER_VC_OR_CLANG_WIN32
#define mkdir _mkdir
#endif
#ifdef _WIN32
return mkdir(path.c_str()) == 0;
#else
return mkdir(path.c_str(), 0755) == 0;
#endif
}
void cThread::Start()

View File

@ -24,48 +24,6 @@
#define DYNACALL
#endif
#ifdef _MSC_VER
#ifdef _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
#undef _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
#endif
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#ifdef _CRT_SECURE_NO_DEPRECATE
#undef _CRT_SECURE_NO_DEPRECATE
#endif
#define _CRT_SECURE_NO_DEPRECATE
//unnamed struncts/unions
#pragma warning( disable : 4201)
//unused parameters
#pragma warning( disable : 4100)
//SHUT UP M$ COMPILER !@#!@$#
#ifdef _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
#undef _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
#endif
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#ifdef _CRT_SECURE_NO_DEPRECATE
#undef _CRT_SECURE_NO_DEPRECATE
#endif
#define _CRT_SECURE_NO_DEPRECATE
#define NOMINMAX
//Do not complain when i use enum::member
#pragma warning( disable : 4482)
//unnamed struncts/unions
#pragma warning( disable : 4201)
//unused parameters
#pragma warning( disable : 4100)
#endif
#include <cstdint>
#include <cstddef>
#include <cstring>
@ -300,10 +258,7 @@ bool dc_unserialize(void **data, unsigned int *total_size);
#define REICAST_SA(v_arr,num) rc_serialize((v_arr), sizeof((v_arr)[0])*(num), data, total_size)
#define REICAST_USA(v_arr,num) rc_unserialize((v_arr), sizeof((v_arr)[0])*(num), data, total_size)
#if COMPILER_VC_OR_CLANG_WIN32
#pragma warning( disable : 4127 4996 /*4244*/)
#else
#ifndef _MSC_VER
#define stricmp strcasecmp
#endif

View File

@ -1,11 +1,8 @@
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <windowsx.h>
#include "hw/mem/_vmem.h"
#include "hw/sh4/sh4_if.h"
#include <windows.h>
// Implementation of the vmem related function for Windows platforms.
// For now this probably does some assumptions on the CPU/platform.

View File

@ -15,13 +15,9 @@
#include "hw/maple/maple_devs.h"
#include "emulator.h"
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <windowsx.h>
#include <xinput.h>
#pragma comment(lib, "XInput9_1_0.lib")
PCHAR*
CommandLineToArgvA(
PCHAR CmdLine,