Skip to content

Commit

Permalink
feat(types): unsigned long width sanity check
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Martins <josemartins90@gmail.com>
  • Loading branch information
josecm authored and danielRep committed Oct 14, 2023
1 parent 0b90e00 commit f224651
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/core/inc/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
#include <stddef.h>
#include <limits.h>

/**
* We assume LP64 and ILP32 for 64- and 32-bit architectures, respectively, as
* throughout the code `unsigned long` is the type used for values of the
* architecture's word width. This is just a sanity check to verify this is the
* ABI the compiler is effectively using.
*/
#if UINTPTR_WIDTH != ULONG_WIDTH
#error "Unsigned long type width is not the same as the architecture´s word with"
#endif

typedef signed long ssize_t;

typedef unsigned long asid_t;
Expand Down

0 comments on commit f224651

Please sign in to comment.