Skip to content

Commit f6f7257

Browse files
authored
Merge pull request #2600 from 3405691582/Prefix_CommonOSDecls
[CF] Go from three sets of OS* decls to two.
2 parents a5f74c3 + 8cc10c8 commit f6f7257

File tree

1 file changed

+19
-35
lines changed

1 file changed

+19
-35
lines changed

CoreFoundation/Base.subproj/CoreFoundation_Prefix.h

Lines changed: 19 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,25 @@ typedef int boolean_t;
133133
#include <sys/stat.h> // mode_t
134134
#endif
135135

136+
#if TARGET_OS_LINUX || TARGET_OS_BSD
137+
// Implemented in CFPlatform.c
138+
bool OSAtomicCompareAndSwapPtr(void *oldp, void *newp, void *volatile *dst);
139+
bool OSAtomicCompareAndSwapLong(long oldl, long newl, long volatile *dst);
140+
bool OSAtomicCompareAndSwapPtrBarrier(void *oldp, void *newp, void *volatile *dst);
141+
bool OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue, volatile int64_t *__theValue );
142+
143+
int32_t OSAtomicDecrement32Barrier(volatile int32_t *dst);
144+
int32_t OSAtomicIncrement32Barrier(volatile int32_t *dst);
145+
int32_t OSAtomicIncrement32(volatile int32_t *theValue);
146+
int32_t OSAtomicDecrement32(volatile int32_t *theValue);
147+
148+
int32_t OSAtomicAdd32( int32_t theAmount, volatile int32_t *theValue );
149+
int32_t OSAtomicAdd32Barrier( int32_t theAmount, volatile int32_t *theValue );
150+
bool OSAtomicCompareAndSwap32Barrier( int32_t oldValue, int32_t newValue, volatile int32_t *theValue );
151+
152+
void OSMemoryBarrier();
153+
#endif // TARGET_OS_LINUX || TARGET_OS_BSD
154+
136155
#if TARGET_OS_LINUX
137156

138157
#define CF_PRIVATE extern __attribute__((visibility("hidden")))
@@ -183,23 +202,6 @@ strlcat(char * dst, const char * src, size_t maxlen) {
183202
#if !TARGET_OS_CYGWIN && !TARGET_OS_BSD
184203
#define issetugid() 0
185204
#endif
186-
187-
// Implemented in CFPlatform.c
188-
bool OSAtomicCompareAndSwapPtr(void *oldp, void *newp, void *volatile *dst);
189-
bool OSAtomicCompareAndSwapLong(long oldl, long newl, long volatile *dst);
190-
bool OSAtomicCompareAndSwapPtrBarrier(void *oldp, void *newp, void *volatile *dst);
191-
bool OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue, volatile int64_t *__theValue );
192-
193-
int32_t OSAtomicDecrement32Barrier(volatile int32_t *dst);
194-
int32_t OSAtomicIncrement32Barrier(volatile int32_t *dst);
195-
int32_t OSAtomicIncrement32(volatile int32_t *theValue);
196-
int32_t OSAtomicDecrement32(volatile int32_t *theValue);
197-
198-
int32_t OSAtomicAdd32( int32_t theAmount, volatile int32_t *theValue );
199-
int32_t OSAtomicAdd32Barrier( int32_t theAmount, volatile int32_t *theValue );
200-
bool OSAtomicCompareAndSwap32Barrier( int32_t oldValue, int32_t newValue, volatile int32_t *theValue );
201-
202-
void OSMemoryBarrier();
203205

204206
#if TARGET_OS_CYGWIN
205207
#define HAVE_STRUCT_TIMESPEC 1
@@ -230,24 +232,6 @@ CF_INLINE uint64_t mach_absolute_time() {
230232
#define CF_PRIVATE extern __attribute__((visibility("hidden")))
231233
#define __strong
232234
#define __weak
233-
234-
// Implemented in CFPlatform.c
235-
bool OSAtomicCompareAndSwapPtr(void *oldp, void *newp, void *volatile *dst);
236-
bool OSAtomicCompareAndSwapLong(long oldl, long newl, long volatile *dst);
237-
bool OSAtomicCompareAndSwapPtrBarrier(void *oldp, void *newp, void *volatile *dst);
238-
bool OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue, volatile int64_t *__theValue );
239-
240-
int32_t OSAtomicDecrement32Barrier(volatile int32_t *dst);
241-
int32_t OSAtomicIncrement32Barrier(volatile int32_t *dst);
242-
int32_t OSAtomicIncrement32(volatile int32_t *theValue);
243-
int32_t OSAtomicDecrement32(volatile int32_t *theValue);
244-
245-
int32_t OSAtomicAdd32( int32_t theAmount, volatile int32_t *theValue );
246-
int32_t OSAtomicAdd32Barrier( int32_t theAmount, volatile int32_t *theValue );
247-
bool OSAtomicCompareAndSwap32Barrier( int32_t oldValue, int32_t newValue, volatile int32_t *theValue );
248-
249-
void OSMemoryBarrier();
250-
251235
#endif
252236

253237
#if TARGET_OS_LINUX || TARGET_OS_BSD

0 commit comments

Comments
 (0)