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

cmake libretro "Visual Studio 15 2017" #1196

Closed
wants to merge 2 commits into from
Closed

cmake libretro "Visual Studio 15 2017" #1196

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 1, 2018

No description provided.

@@ -46,6 +46,7 @@ typedef intptr_t ssize_t;
#define snprintf _snprintf
#define strdup _strdup
#define lseek _lseek
#define __builtin_bswap32 _byteswap_ulong
Copy link
Member

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.

Copy link
Author

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); \
}

??

Copy link
Member

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.

Copy link
Author

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.

CMakeLists.txt Show resolved Hide resolved

#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

Copy link
Member

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__
Copy link
Member

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?

Copy link
Author

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.

@ghost
Copy link
Author

ghost commented Oct 2, 2018

Dirty pr. Squashing and cleaning up.

@ghost ghost closed this Oct 2, 2018
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant