Skip to content

Commit c49e4af

Browse files
author
Jianchun Xu
committed
fix a pal build issue on my machine
Not sure why it does not repro in CI. Maybe my system is updated? finite.cpp includes "pal_internal.h -> pal.h" and has "wchar_t" defined. finite.cpp then includes "math.h -> cmath -> bits/cpp_type_traits.h". This results in error, _is_integer<> specialization duplicated on "__wchar_16_cpp__ (expanded from wchar_t, and typedef to char16_t)" and "char16_t". Temporarily applied a local fix in finite.cpp.
1 parent 4c9b2e2 commit c49e4af

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

pal/src/cruntime/finite.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Copyright (c) Microsoft. All rights reserved.
3-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
44
//
55

66
/*++
@@ -21,7 +21,15 @@ Module Name:
2121

2222
#include "pal/palinternal.h"
2323
#include "pal/dbgmsg.h"
24+
25+
#if defined(__cplusplus)
26+
#undef wchar_t
27+
#endif
2428
#include <math.h>
29+
#if defined(__cplusplus)
30+
#undef wchar_t
31+
#define wchar_t __wchar_16_cpp__
32+
#endif // __cplusplus
2533

2634
#if HAVE_IEEEFP_H
2735
#include <ieeefp.h>
@@ -98,8 +106,8 @@ _isnan(
98106
99107
See MSDN doc
100108
--*/
101-
double
102-
__cdecl
109+
double
110+
__cdecl
103111
_copysign(
104112
double x,
105113
double y)
@@ -246,7 +254,7 @@ PALIMPORT double __cdecl PAL_exp(double x)
246254
PERF_ENTRY(exp);
247255
ENTRY("exp (x=%f)\n", x);
248256
#if !HAVE_COMPATIBLE_EXP
249-
if (x == 1.0)
257+
if (x == 1.0)
250258
{
251259
ret = M_E;
252260
}
@@ -274,8 +282,8 @@ PALIMPORT LONG __cdecl PAL_labs(LONG l)
274282

275283
PERF_ENTRY(labs);
276284
ENTRY("labs (l=%ld)\n", l);
277-
278-
lRet = labs(l);
285+
286+
lRet = labs(l);
279287

280288
LOGEXIT("labs returns long %ld\n", lRet);
281289
PERF_EXIT(labs);

0 commit comments

Comments
 (0)