Allow forcing the emulation mode for testing purposes.

This commit is contained in:
Jordan Bancino 2023-08-12 21:51:51 +00:00
parent 63f835d006
commit e9af54e4c7
2 changed files with 8 additions and 5 deletions

View File

@ -69,7 +69,7 @@
#include <stddef.h>
#if 0 /* TODO REMOVE */
#ifndef INT64_FORCE_EMULATED
#define BIT64_MAX 18446744073709551615UL
@ -85,7 +85,7 @@ typedef signed long Int64;
#endif
#endif /* TODO REMOVE */
#endif /* ifndef INT64_FORCE_EMULATED */
#ifdef INT64_NATIVE

View File

@ -25,7 +25,7 @@
#define CYTOPLASM_UINT64_H
/***
* @Nm Int64
* @Nm UInt64
* @Nd Fixed-width 64 bit integers.
* @Dd August 11, 2023
*
@ -68,9 +68,9 @@
#include <stddef.h>
#define BIT64_MAX 18446744073709551615UL
#ifndef INT64_FORCE_EMULATED
/* TODO: Implement signed arithmetic */
#define BIT64_MAX 18446744073709551615UL
#if UINT_MAX == BIT64_MAX
/* typedef signed int Int64; */
@ -86,6 +86,8 @@ typedef unsigned long UInt64;
#endif
#endif /* ifndef INT64_FORCE_EMULATED */
#ifdef UINT64_NATIVE
#define UInt64Create(high, low) (((UInt64) (high) << 32) | (low))
@ -209,6 +211,7 @@ extern UInt64 UInt64Not(UInt64);
/**
* Perform a comparison of the provided 64 bit integers and return a C
* boolean that is true if and only if they are equal.
*/
extern int UInt64Eq(UInt64, UInt64);
/**