Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5758685

Browse files
committed
Fix8a934d6 for libc++ and make more include order resistant.
The previous definition was used in C++ mode, which causes problemswhen using clang with libc++ (rather than libstdc++), due to bugstherein. So just avoid in C++ mode.A second problem is that depending on include order and implicitincludes the previous definition did not guarantee that the currenthack was effective by the time isinf was used, fix that by forcingmath.h to be included. This can cause clang using builds, or gccusing ones with JIT enabled, to slow down noticably.It's likely that we at some point want a better solution for theperformance problem, but while it's there it should better work.Reported-By: Steven WinfieldBug: #15270Discussion:https://postgr.es/m/153116283147.1401.360416241833049560@wrigleys.postgresql.orgAuthor: Andres FreundBackpatch: 11, like the previous commit.
1 parent115bf1e commit5758685

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎src/include/port.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,15 +347,18 @@ extern intisinf(double x);
347347
/*
348348
* Glibc doesn't use the builtin for clang due to a *gcc* bug in a version
349349
* newer than the gcc compatibility clang claims to have. This would cause a
350-
* *lot* of superfluous function calls, therefore revert when using clang.
350+
* *lot* of superfluous function calls, therefore revert when using clang. In
351+
* C++ there's issues with libc++ (not libstdc++), so disable as well.
351352
*/
352-
#ifdef__clang__
353+
#if defined(__clang__)&& !defined(__cplusplus)
353354
/* needs to be separate to not confuse other compilers */
354355
#if__has_builtin(__builtin_isinf)
356+
/* need to include before, to avoid getting overwritten */
357+
#include<math.h>
355358
#undef isinf
356359
#defineisinf __builtin_isinf
357360
#endif/* __has_builtin(isinf) */
358-
#endif/* __clang__ */
361+
#endif/* __clang__&& !__cplusplus*/
359362
#endif/* !HAVE_ISINF */
360363

361364
#ifndefHAVE_MKDTEMP

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp