Skip to content

Commit

Permalink
lib/replace: force to unset defines if check has failed
Browse files Browse the repository at this point in the history
For HAVE_WORKING_STRPTIME and HAVE_INCOHERENT_MMAP we always want to
have their defines unset as the code is using '#ifdef' rather than just
'#if'. Setting them to 0 means #ifdef will succeed due to a difference
how '#ifdef' and '#if' are working.

Signed-off-by: Alexander Bokovoy <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
  • Loading branch information
abbra authored and abartlet committed Sep 8, 2018
1 parent 95ba6b9 commit 8ec7eb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/replace/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ def configure(conf):
define='HAVE_WORKING_STRPTIME',
execute=True,
addmain=False,
always=True,
msg='Checking for working strptime')

conf.CHECK_C_PROTOTYPE('gettimeofday',
Expand Down Expand Up @@ -646,7 +647,7 @@ def configure(conf):
# OpenBSD (and I've heard HPUX) doesn't sync between mmap and write.
# FIXME: Anything other than a 0 or 1 exit code should abort configure!
conf.CHECK_CODE('#include "test/incoherent_mmap.c"',
addmain=False, add_headers=False, execute=True,
addmain=False, add_headers=False, execute=True, always=True,
define='HAVE_INCOHERENT_MMAP',
msg="Checking for HAVE_INCOHERENT_MMAP")

Expand Down

0 comments on commit 8ec7eb0

Please sign in to comment.