Skip to content

Commit b024690

Browse files
committed
[flang] Fix Darwin build after 4762c65
Select POSIX 2008 standard to avoid including Darwin extensions. Otherwise, Darwin's math.h header defines HUGE, which conflicts with Flang's HUGE function. This is a temporary build fix. More permanent solutions would be to rename Flang's HUGE or to define _POSIX_C_SOURCE for Flang as a whole. This started happening after 4762c65 (llvm#82443), that added the "utility" include, which seems to include "math.h".
1 parent 4d478bc commit b024690

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

flang/lib/Decimal/decimal-to-binary.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#define _POSIX_C_SOURCE 200809
10+
911
#include "big-radix-floating-point.h"
1012
#include "flang/Common/bit-population-count.h"
1113
#include "flang/Common/leading-zero-bit-count.h"

0 commit comments

Comments
 (0)