Skip to content

Commit 62ec238

Browse files
committed
fix circular header inclusion
1 parent f262972 commit 62ec238

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

src/util/asserts.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111
#include <assert.h>
1212

13-
#include "lock_ops.h"
14-
#include "macros.h"
15-
1613
#define ASSERT assert
1714
#define ASSERT_MSG(__cond, __msg) assert((__cond) && (__msg))
1815
#define ASSERT_NOT_NULL(__var) assert(__var != NULL)
@@ -22,20 +19,6 @@
2219
#define ASSERT_EGL_TRUE(__var) assert((__var) == EGL_TRUE)
2320
#define ASSERT_EGL_TRUE_MSG(__var, __msg) ASSERT_MSG((__var) == EGL_TRUE, __msg)
2421

25-
#ifdef DEBUG
26-
static inline void assert_mutex_locked(pthread_mutex_t *mutex) {
27-
int result = pthread_mutex_trylock(mutex);
28-
if (result == 0) {
29-
pthread_mutex_unlock(mutex);
30-
ASSERT_MSG(false, "Mutex is not locked.");
31-
}
32-
}
33-
#else
34-
static inline void assert_mutex_locked(mutex_t *mutex) {
35-
(void) mutex;
36-
}
37-
#endif
38-
3922
#define ASSERT_ZERO(__var) assert((__var) == 0)
4023
#define ASSERT_ZERO_MSG(__var, __msg) ASSERT_MSG((__var) == 0, __msg)
4124

src/util/lock_ops.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,18 @@
5959
(void) ok; \
6060
}
6161

62+
#ifdef DEBUG
63+
static inline void assert_mutex_locked(pthread_mutex_t *mutex) {
64+
int result = pthread_mutex_trylock(mutex);
65+
if (result == 0) {
66+
pthread_mutex_unlock(mutex);
67+
ASSERT_MSG(false, "Mutex is not locked.");
68+
}
69+
}
70+
#else
71+
static inline void assert_mutex_locked(mutex_t *mutex) {
72+
(void) mutex;
73+
}
74+
#endif
75+
6276
#endif // _FLUTTERPI_SRC_UTIL_LOCK_OPS_H

0 commit comments

Comments
 (0)