Skip to content

Conversation

@judearich
Copy link

This is a general PR to fix a couple bugs and improve the portability of typecard.

Here is a list of the changes:

  • Use a function to print the size of types for better readability.
  • Add intptr_t to the list of types printed.
  • Use CHAR_BIT for bits-per-byte instead of the literal 8.
  • Calculate CPU bit-width using sizeof(void*) instead of __LP64__ to
    allow for non-32/64-bit values.
  • Add check for PDP Endianness.
  • Use correct preprocessor macros to check for endianness and
    presence of __int128_t.

Variable printing was put into a function for better readability.
CHAR_BIT is used instead of a literal 8 for better portability. The
system bit-width is now detected by checking the size of a pointer. The
proper preprocesor macro is now used for testing for __int128_t. Endian
testing macros were moved out of main, support for PDP endianness has
been added, and the proper GCC endian preprocessor macros are used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant