Skip to content

Commit

Permalink
Merge pull request swiftlang#2604 from 3405691582/Prefix_CommonLocale…
Browse files Browse the repository at this point in the history
…Aliases

[CF] Unify common locale macros.
  • Loading branch information
compnerd authored Jan 14, 2020
2 parents 97bfd79 + 89ecec8 commit e6e0046
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions CoreFoundation/Base.subproj/CoreFoundation_Prefix.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,22 @@ bool OSAtomicCompareAndSwap32Barrier( int32_t oldValue, int32_t newValue, volati
void OSMemoryBarrier();
#endif // TARGET_OS_LINUX || TARGET_OS_BSD

#if TARGET_OS_LINUX || TARGET_OS_WIN32
#define strtod_l(a,b,locale) strtod(a,b)
#define strtoul_l(a,b,c,locale) strtoul(a,b,c)
#define strtol_l(a,b,c,locale) strtol(a,b,c)

#define fprintf_l(a,locale,b,...) fprintf(a, b, __VA_ARGS__)
#endif // TARGET_OS_LINUX || TARGET_OS_WIN32

#if TARGET_OS_LINUX

#define CF_PRIVATE extern __attribute__((visibility("hidden")))
#define __weak

#define strtod_l(a,b,locale) strtod(a,b)
#define strtoul_l(a,b,c,locale) strtoul(a,b,c)
#define strtol_l(a,b,c,locale) strtol(a,b,c)
#define strtoll_l(a,b,c,locale) strtoll(a,b,c)
#define strncasecmp_l(a, b, c, d) strncasecmp(a, b, c)

#define fprintf_l(a,locale,b,...) fprintf(a, b, __VA_ARGS__)

#include <pthread.h>

#if TARGET_OS_ANDROID
Expand Down Expand Up @@ -346,16 +349,11 @@ CF_INLINE long long llabs(long long v) {
return v;
}

#define strtod_l(a,b,locale) strtod(a,b)
#define strtoul_l(a,b,c,locale) strtoul(a,b,c)
#define strtol_l(a,b,c,locale) strtol(a,b,c)
#define strtoll_l(a,b,c,locale) _strtoi64(a,b,c)
#define strncasecmp(a, b, c) _strnicmp(a, b, c)
#define strncasecmp_l(a, b, c, d) _strnicmp(a, b, c)
#define snprintf _snprintf

#define fprintf_l(a,locale,b,...) fprintf(a, b, __VA_ARGS__)

#define sleep(x) Sleep(1000*x)

#define issetugid() 0
Expand Down

0 comments on commit e6e0046

Please sign in to comment.