Skip to content

Commit 111b292

Browse files
committed
Scope poison float/double to unit tests
1 parent 79d3fcd commit 111b292

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/mpack/mpack-platform.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,14 +1025,12 @@ void mpack_assert_fail(const char* message);
10251025

10261026
// If we don't have support for float or double, we poison the identifiers to
10271027
// make sure we don't define anything related to them.
1028-
#if MPACK_INTERNAL
1029-
#ifdef __GNUC__
1030-
#if !MPACK_FLOAT
1031-
#pragma GCC poison float
1032-
#endif
1033-
#if !MPACK_DOUBLE
1034-
#pragma GCC poison double
1035-
#endif
1028+
#if MPACK_INTERNAL && defined(MPACK_UNIT_TESTS) && defined(__GNUC__)
1029+
#if !MPACK_FLOAT
1030+
#pragma GCC poison float
1031+
#endif
1032+
#if !MPACK_DOUBLE
1033+
#pragma GCC poison double
10361034
#endif
10371035
#endif
10381036

0 commit comments

Comments
 (0)