1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-04 04:50:22 +00:00

Include stdint.h on Windows, change integer defines to use them

It seems we weren't including stdint.h on Windows by mistake. Likely we
were getting it anywy from some other header, but it sounds like that
got changed in newer versions of MinGW and either way we shouldn't rely
on that.

Being that we include stdint.h on all platforms, I also changed os.h to
always use these types when defining the `int32` and friends sized
types. Ideally we get rid of those defines in the future but we can at
least use the stdint.h types going forward (as we already have).
This commit is contained in:
Matthew Kilgore 2022-11-12 19:37:34 -05:00
parent 1509f85719
commit e6964dfc69
2 changed files with 9 additions and 20 deletions

View file

@ -59,6 +59,7 @@
//#include <math.h> //<-causes overloading abs conflicts in Windows
# include <cmath>
# endif
# include <stdint.h>
# include <errno.h>
# include <fcntl.h>
# include <fstream>
@ -82,7 +83,6 @@
# else
# include <pthread.h>
# include <stdint.h>
# include <stdlib.h>
# include <sys/stat.h>
# include <sys/types.h>

View file

@ -7,25 +7,14 @@
* Should this be adapted to check for each type before defining?
*/
#ifndef QB64_OS_H_NO_TYPES
# ifdef QB64_WINDOWS
# define uint64 unsigned __int64
# define uint32 unsigned __int32
# define uint16 unsigned __int16
# define uint8 unsigned __int8
# define int64 __int64
# define int32 __int32
# define int16 __int16
# define int8 __int8
# else
# define int64 int64_t
# define int32 int32_t
# define int16 int16_t
# define int8 int8_t
# define uint64 uint64_t
# define uint32 uint32_t
# define uint16 uint16_t
# define uint8 uint8_t
# endif
# define int64 int64_t
# define int32 int32_t
# define int16 int16_t
# define int8 int8_t
# define uint64 uint64_t
# define uint32 uint32_t
# define uint16 uint16_t
# define uint8 uint8_t
# define ptrszint intptr_t
# define uptrszint uintptr_t