-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add new BINJNES_{CLANG,GCC,MSVC} preprocessor defines * Remove Linux-only compile flags * Remove Linux-only linked libraries * Add platform-specific atomic.h (stdatomic for C is not supported in my version of MSVC) * Fix some MSVC compiler warnings * Repurpose UNREACHABLE as __builtin_unreachable/__assume(0) * MSVC doesn't allow you to predeclare an indeterminately sized array :-/ * Extend vec library to support all uses needed for emulator.c (e.g. don't use vector extensions) * Fix alignment bug in apu_tick. Previously this code was forcing unaligned accesses to make it work. This didn't seem to work on MSVC. Now it is always aligned and masks off parts of the calculation that are not used * Remove uses of case range extension
- Loading branch information
Showing
10 changed files
with
815 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/bin/ | ||
/out/ | ||
/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#if defined(BINJNES_GCC) || defined(BINJNES_CLANG) | ||
|
||
#include <stdatomic.h> | ||
|
||
typedef atomic_size_t AtomicSize; | ||
static inline size_t atomic_load_size(AtomicSize* addr) { | ||
return atomic_load(addr); | ||
} | ||
|
||
static inline void atomic_store_size(AtomicSize* addr, size_t value) { | ||
atomic_store(addr, value); | ||
} | ||
|
||
#elif defined(BINJNES_MSVC) | ||
|
||
#define WIN32_LEAN_AND_MEAN | ||
#define NOMINMAX | ||
#include <windows.h> | ||
#undef ERROR | ||
|
||
typedef volatile PVOID AtomicSize; | ||
|
||
size_t atomic_load_size(AtomicSize* addr) { | ||
return (size_t)*addr; | ||
} | ||
|
||
void atomic_store_size(AtomicSize* addr, size_t value) { | ||
_InterlockedExchangePointer(addr, (PVOID)value); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.