};\r
\r
#define ONCE_FLAG_INIT _PDCLIB_ONCE_FLAG_INIT\r
-#if defined(_PDCLIB_ONCE_FLAG_DONE)\r
+#if defined(_PDCLIB_ONCE_FLAG_IS_DONE)\r
static inline void call_once(once_flag *flag, void (*func)(void))\r
{\r
- if(*flag != _PDCLIB_ONCE_FLAG_DONE) {\r
+ if(_PDCLIB_ONCE_FLAG_IS_DONE(flag)) {\r
_PDCLIB_call_once(flag, func);\r
}\r
}\r
\r
_PDCLIB_BEGIN_EXTERN_C\r
#define _PDCLIB_ONCE_FLAG_INIT 0\r
-#define _PDCLIB_ONCE_FLAG_DONE 1\r
+#define _PDCLIB_ONCE_FLAG_IS_DONE(_f) ((_f) == 1)\r
typedef char _PDCLIB_once_flag;\r
\r
void _PDCLIB_call_once(_PDCLIB_once_flag *flag, void (*func)(void));\r