diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/nx/win/nxonce.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/replicant/nx/win/nxonce.h')
-rw-r--r-- | Src/replicant/nx/win/nxonce.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Src/replicant/nx/win/nxonce.h b/Src/replicant/nx/win/nxonce.h new file mode 100644 index 00000000..7cdd53a6 --- /dev/null +++ b/Src/replicant/nx/win/nxonce.h @@ -0,0 +1,35 @@ +#pragma once +#include "nxapi.h" +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include <windows.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#if 0 && _WIN32_WINNT >= 0x600 + typedef INIT_ONCE nx_once_value_t; + typedef INIT_ONCE *nx_once_t; +#define NX_ONCE_INITIALIZE INIT_ONCE_STATIC_INIT +#define NX_ONCE_API CALLBACK + +NX_API void NXOnce(nx_once_t once, int (NX_ONCE_API *init_fn)(nx_once_t, void *, void **), void *param); +NX_API void NXOnceInit(nx_once_t once); +#else + typedef struct nx_once_s + { + volatile int status; + CRITICAL_SECTION critical_section; + } nx_once_value_t, *nx_once_t; + +#define NX_ONCE_API + + NX_API void NXOnce(nx_once_t once, int (NX_ONCE_API *init_fn)(nx_once_t, void *, void **), void *); + NX_API void NXOnceInit(nx_once_t once); + +#endif +#ifdef __cplusplus +} +#endif
\ No newline at end of file |