-
-
Notifications
You must be signed in to change notification settings - Fork 764
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
cmake libretro "Visual Studio 15 2017" #1196
Conversation
include/mgba-util/common.h
Outdated
@@ -46,6 +46,7 @@ typedef intptr_t ssize_t; | |||
#define snprintf _snprintf | |||
#define strdup _strdup | |||
#define lseek _lseek | |||
#define __builtin_bswap32 _byteswap_ulong |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide a different implementation of LOAD_32BE
instead of __builtin_bswap32
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define LOAD_32BE(DEST, ADDR, ARR) { \
uint32_t _val = ((uint32_t*) ARR)[(ADDR) >> 2]; \
DEST = (_val << 24) | ((_val & 0xff00) << 8) | ((_val & 0xff0000) >> 8) | (_val >> 24); \
}
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I meant using _byteswap_ulong instead of __builtin_bswap32 for the MSVC build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#ifdef _MSC_VER
#define LOAD_32BE(DEST, ADDR, ARR) DEST = _byteswap_ulong(((uint32_t*) ARR)[(ADDR) >> 2])
#else
#define LOAD_32BE(DEST, ADDR, ARR) DEST = __builtin_bswap32(((uint32_t*) ARR)[(ADDR) >> 2])
#endif
If I messed this up too, I'll resubmit a squashed clean pr when it's proper fixed.
|
||
#ifdef _MSC_VER | ||
#define LOAD_32BE(DEST, ADDR, ARR) DEST = _byteswap_ulong(((uint32_t*) ARR)[(ADDR) >> 2]) | ||
#else | ||
#define LOAD_32BE(DEST, ADDR, ARR) DEST = __builtin_bswap32(((uint32_t*) ARR)[(ADDR) >> 2]) | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this extra new line.
@@ -51,7 +51,9 @@ typedef intptr_t ssize_t; | |||
#include <sys/time.h> | |||
typedef intptr_t ssize_t; | |||
#else | |||
#ifndef __CELLOS_LV2__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this get added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to rebase my offline work files. Will do that.
Dirty pr. Squashing and cleaning up. |
No description provided.