-
Notifications
You must be signed in to change notification settings - Fork 8
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
add support for MinGW32 compiler #9
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,13 +107,24 @@ void gt2MemCopy(char* out, char const* in, int size) | |
|
||
#else | ||
|
||
#ifdef __MINGW32__ | ||
#define GT_ENCODE_ELEM(TYPE, b, l, args) \ | ||
{ \ | ||
if (l < sizeof(TYPE)) \ | ||
return -1; \ | ||
TYPE temp = va_arg(*args, TYPE); \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again no need to gate this behind mingw, but it would need fixing to C89 standards, so TYPE temp; needs to go at the top of the scope. A better fix is just to add |
||
gt2MemCopy(b, (const char*)&temp, sizeof(TYPE)); \ | ||
return sizeof(TYPE); \ | ||
} | ||
#else | ||
#define GT_ENCODE_ELEM(TYPE, b, l, args) \ | ||
{ \ | ||
if (l < sizeof(TYPE)) \ | ||
return -1; \ | ||
gt2MemCopy(b, (const char*)&va_arg(*args, TYPE), sizeof(TYPE)); \ | ||
return sizeof(TYPE); \ | ||
} | ||
#endif | ||
#define GT_DECODE_ELEM(TYPE, b, l, args) \ | ||
{ \ | ||
if (l < sizeof(TYPE)) \ | ||
|
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.
Don't gate this change behind just mingw, it should work for msvc as well.