Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some syntax errors when compiling via msbuild 2019 compiler toolchain #763

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/libkirk/amctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright (C) 2015 Hykem <hykem@hotmail.com>
// Licensed under the terms of the GNU GPL, version 3
// http://www.gnu.org/licenses/gpl-3.0.txt

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
Expand Down
5 changes: 3 additions & 2 deletions libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ retro_input_state_t dbg_input_state_cb = 0;
#endif

#if defined(HAVE_SHM) || defined(HAVE_ASHMEM)
#include <unistd.h> // for ftruncate
#include <sys/stat.h>
#include <fcntl.h>
#endif
Expand All @@ -52,7 +53,7 @@ retro_input_state_t dbg_input_state_cb = 0;
#endif /* HAVE_LIGHTREC */

//Fast Save States exclude string labels from variables in the savestate, and are at least 20% faster.
extern bool FastSaveStates;
extern "C" bool FastSaveStates;
const int DEFAULT_STATE_SIZE = 16 * 1024 * 1024;

static bool libretro_supports_bitmasks = false;
Expand Down Expand Up @@ -107,7 +108,7 @@ int memfd;
#endif
#endif

uint32 EventCycles = 128;
int32 EventCycles = 128;

// CPU overclock factor (or 0 if disabled)
int32_t psx_overclock_factor = 0;
Expand Down
7 changes: 2 additions & 5 deletions mednafen/clamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ extern "C" {
#endif

#include <stddef.h>
#ifndef _WIN32
#include <unistd.h>
#endif

static INLINE void clamp(int32_t *val, ssize_t min, ssize_t max)
// ptrdiff_t (adopted by C99/C++) is generally a more portable version of ssize_t (POSIX only).
static INLINE void clamp(int32_t *val, ptrdiff_t min, ptrdiff_t max)
{
if(*val < min)
*val = min;
Expand Down
7 changes: 5 additions & 2 deletions mednafen/mednafen-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ typedef uint64_t uint64;
#define MDFN_MAKE_GCCV(maj,min,pl) (((maj)*100*100) + ((min) * 100) + (pl))
#define MDFN_GCC_VERSION MDFN_MAKE_GCCV(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)

#ifndef INLINE
#ifndef INLINE
#define INLINE inline __attribute__((always_inline))
#endif
#endif

#define NO_INLINE __attribute__((noinline))

Expand Down Expand Up @@ -176,7 +176,10 @@ typedef uint64_t uint64;
// Begin MSVC
//

#if !defined(INLINE)
#define INLINE __forceinline
#endif

#define NO_INLINE __declspec(noinline)
#define NO_CLONE

Expand Down
2 changes: 1 addition & 1 deletion mednafen/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int StateAction(StateMem *sm, int load, int data_only);
* variables in the savestate, and are at least 20% faster.
* Only used for internal savestates which will not be written to a file. */

bool FastSaveStates = false;
_Bool FastSaveStates = false;

static INLINE void MDFN_en32lsb_(uint8_t *buf, uint32_t morp)
{
Expand Down
1 change: 1 addition & 0 deletions parallel-psx/util/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ extern retro_log_printf_t libretro_log;
#define LOGI(...) do { if (::Granite::libretro_log) ::Granite::libretro_log(RETRO_LOG_INFO, __VA_ARGS__); } while(0)
#elif defined(_MSC_VER)
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <windows.h>
#define LOGE(...) do { \
fprintf(stderr, "[ERROR]: " __VA_ARGS__); \
Expand Down