Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,8 @@ if (UNIX) # unlikely to be an issue on Windows
# and set DR_DO_NOT_DEFINE_*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's specify the C dialet used by our main codebase, GNU C99, explicitly when checking for existence of types, to keep

spelling: dialect

# Note that for later gcc uint and ushort seem to be "soft typedefs":
# defined, but overridable: ?!?
set(CMAKE_ORIG_C_FLAGS "${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
Copy link
Contributor

@derekbruening derekbruening May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the issue is that gnu99 is not passed everywhere, shouldn't we solve that? Adding this temporary gnu99 just for these checks does not seem the best approach. There is also no comment here explaining why we'd set a flag and then unset it so this going to be confusing to future readers without explanation.

include(CheckTypeSize)
CHECK_TYPE_SIZE(uint DR_DO_NOT_DEFINE_uint)
CHECK_TYPE_SIZE(ushort DR_DO_NOT_DEFINE_ushort)
Expand All @@ -821,6 +823,7 @@ if (UNIX) # unlikely to be an issue on Windows
message(FATAL_ERROR "incompatible \"_Bool\" type is larger than 1 byte")
endif (NOT ${DR__Bool_EXISTS} EQUAL 1)
endif (DR__Bool_EXISTS)
set(CMAKE_C_FLAGS "${CMAKE_ORIG_C_FLAGS}")
endif (UNIX)

###########################################################################
Expand Down
Loading