Skip to content

Commit e6e0046

Browse files
authored
Merge pull request #2604 from 3405691582/Prefix_CommonLocaleAliases
[CF] Unify common locale macros.
2 parents 97bfd79 + 89ecec8 commit e6e0046

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

CoreFoundation/Base.subproj/CoreFoundation_Prefix.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,22 @@ bool OSAtomicCompareAndSwap32Barrier( int32_t oldValue, int32_t newValue, volati
180180
void OSMemoryBarrier();
181181
#endif // TARGET_OS_LINUX || TARGET_OS_BSD
182182

183+
#if TARGET_OS_LINUX || TARGET_OS_WIN32
184+
#define strtod_l(a,b,locale) strtod(a,b)
185+
#define strtoul_l(a,b,c,locale) strtoul(a,b,c)
186+
#define strtol_l(a,b,c,locale) strtol(a,b,c)
187+
188+
#define fprintf_l(a,locale,b,...) fprintf(a, b, __VA_ARGS__)
189+
#endif // TARGET_OS_LINUX || TARGET_OS_WIN32
190+
183191
#if TARGET_OS_LINUX
184192

185193
#define CF_PRIVATE extern __attribute__((visibility("hidden")))
186194
#define __weak
187195

188-
#define strtod_l(a,b,locale) strtod(a,b)
189-
#define strtoul_l(a,b,c,locale) strtoul(a,b,c)
190-
#define strtol_l(a,b,c,locale) strtol(a,b,c)
191196
#define strtoll_l(a,b,c,locale) strtoll(a,b,c)
192197
#define strncasecmp_l(a, b, c, d) strncasecmp(a, b, c)
193198

194-
#define fprintf_l(a,locale,b,...) fprintf(a, b, __VA_ARGS__)
195-
196199
#include <pthread.h>
197200

198201
#if TARGET_OS_ANDROID
@@ -346,16 +349,11 @@ CF_INLINE long long llabs(long long v) {
346349
return v;
347350
}
348351

349-
#define strtod_l(a,b,locale) strtod(a,b)
350-
#define strtoul_l(a,b,c,locale) strtoul(a,b,c)
351-
#define strtol_l(a,b,c,locale) strtol(a,b,c)
352352
#define strtoll_l(a,b,c,locale) _strtoi64(a,b,c)
353353
#define strncasecmp(a, b, c) _strnicmp(a, b, c)
354354
#define strncasecmp_l(a, b, c, d) _strnicmp(a, b, c)
355355
#define snprintf _snprintf
356356

357-
#define fprintf_l(a,locale,b,...) fprintf(a, b, __VA_ARGS__)
358-
359357
#define sleep(x) Sleep(1000*x)
360358

361359
#define issetugid() 0

0 commit comments

Comments
 (0)