Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pal/inc/pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -6411,6 +6411,7 @@ PALIMPORT double __cdecl _copysign(double, double);

#if !defined(PAL_STDCPP_COMPAT) || defined(USING_PAL_STDLIB)

#ifdef PLATFORM_ACCEPTS_ABS_OVERLOAD
#ifdef __cplusplus
extern "C++" {

Expand All @@ -6420,6 +6421,7 @@ inline __int64 abs(__int64 _X) {

}
#endif
#endif

PALIMPORT void * __cdecl malloc(size_t);
PALIMPORT void __cdecl free(void *);
Expand Down
15 changes: 15 additions & 0 deletions pal/src/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ check_cxx_symbol_exists(_DEBUG sys/user.h USER_H_DEFINES_DEBUG)
check_cxx_symbol_exists(_SC_PHYS_PAGES unistd.h HAVE__SC_PHYS_PAGES)
check_cxx_symbol_exists(_SC_AVPHYS_PAGES unistd.h HAVE__SC_AVPHYS_PAGES)

check_cxx_source_runs("
#include <stdlib.h>
#include <stdio.h>

extern \"C++\" {
inline long long abs(long long _X) {
return llabs(_X);
}
}

int main(int argc, char **argv) {
long long X = 123456789 + argc;
printf(\"%lld\", abs(X));
exit(0);
}" PLATFORM_ACCEPTS_ABS_OVERLOAD)
check_cxx_source_runs("
#include <sys/param.h>
#include <stdlib.h>
Expand Down
7 changes: 7 additions & 0 deletions pal/src/include/pal/palinternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -677,4 +677,11 @@ inline T* InterlockedCompareExchangePointerT(

#endif // __cplusplus

#ifndef max
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, why is this needed for fedora and not needed for ubuntu? pal.h also defines min and max, so this seems unnecessary but I saw the same compile error as you. Can you explain why that definition is insufficient?

Copy link
Collaborator Author

@obastemur obastemur Jul 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC; NO_PAL_MINMAX was being defined in the chain by mistake. Edit: not that our mistake though..

#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif

#endif /* _PAL_INTERNAL_H_ */