Skip to content

Commit e363489

Browse files
compnerdphausler
authored andcommitted
Base: merge two identical CPP cases (#370)
The two cases are identical. Merge them to avoid the unnecessary duplication.
1 parent e4e9e1b commit e363489

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

CoreFoundation/Base.subproj/CFInternal.h

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -450,37 +450,18 @@ CF_EXPORT id __NSDictionary0__;
450450
CF_EXPORT id __NSArray0__;
451451

452452

453-
#if DEPLOYMENT_TARGET_MACOSX
454-
455-
typedef pthread_mutex_t CFLock_t;
456-
457-
#define CFLockInit ((pthread_mutex_t)PTHREAD_ERRORCHECK_MUTEX_INITIALIZER)
458-
#define CF_LOCK_INIT_FOR_STRUCTS(X) (X = CFLockInit)
459-
460-
#define __CFLock(LP) ({ \
461-
(void)pthread_mutex_lock(LP); })
462-
463-
#define __CFUnlock(LP) ({ \
464-
(void)pthread_mutex_unlock(LP); })
465-
466-
#define __CFLockTry(LP) ({ \
467-
pthread_mutex_trylock(LP) == 0; })
468-
469-
#elif DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
453+
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
470454

471455
typedef pthread_mutex_t CFLock_t;
472456

473457
#define CFLockInit ((pthread_mutex_t)PTHREAD_ERRORCHECK_MUTEX_INITIALIZER)
474458
#define CF_LOCK_INIT_FOR_STRUCTS(X) (X = CFLockInit)
475459

476-
#define __CFLock(LP) ({ \
477-
(void)pthread_mutex_lock(LP); })
460+
#define __CFLock(LP) ({ (void)pthread_mutex_lock(LP); })
478461

479-
#define __CFUnlock(LP) ({ \
480-
(void)pthread_mutex_unlock(LP); })
462+
#define __CFUnlock(LP) ({ (void)pthread_mutex_unlock(LP); })
481463

482-
#define __CFLockTry(LP) ({ \
483-
pthread_mutex_trylock(LP) == 0; })
464+
#define __CFLockTry(LP) ({ pthread_mutex_trylock(LP) == 0; })
484465

485466
#elif DEPLOYMENT_TARGET_WINDOWS
486467

0 commit comments

Comments
 (0)