mirror of
https://github.com/nmlgc/ReC98.git
synced 2025-02-26 20:55:09 +00:00

Previously sloppily mis-RE'd as "some page variable, idk", back in 2015… Now also with a page number typedef. And yeah, restricting bool to C++ has now proven to be stupid after all. Part of P0067, funded by Splashman.
30 lines
946 B
C
30 lines
946 B
C
/* ReC98
|
|
* -----
|
|
* Platform- and compiler-specific types.
|
|
*/
|
|
|
|
/// <stdint.h>
|
|
/// ----------
|
|
// __TURBOC__ is #define'd on both "Borland" and "Turbo" editions, unlike
|
|
// __BORLANDC__, which is only #define'd on the former.
|
|
#if defined(__TURBOC__) && defined(__MSDOS__)
|
|
typedef char bool;
|
|
# define false 0
|
|
# define true 1
|
|
typedef char int8_t;
|
|
typedef short int16_t;
|
|
typedef long int32_t;
|
|
typedef unsigned char uint8_t;
|
|
typedef unsigned short uint16_t;
|
|
typedef unsigned long uint32_t;
|
|
#else
|
|
# error This code can currently only be compiled on Borland's 16-bit DOS compilers. Ideally, you'd only have to declare <stdint.h> types for your compiler here though?
|
|
#endif
|
|
/// ----------
|
|
|
|
// Both Turbo C++ and master.lib use uint16_t for segment values throughout
|
|
// their APIs instead of the more sensible void __seg*. Maybe, integer
|
|
// arithmetic on segment values was widely considered more important than
|
|
// dereferencing?
|
|
typedef uint16_t seg_t;
|