pkg_conf = import('pkgconfig')
-
vkh_src = [
'src/vkh_app.c',
'src/vkh_buffer.c',
'src/VmaUsage.cpp'
]
-if (host_machine.system() == 'windows')
+if (has_c11_threads_support == false)
vkh_src += 'src/deps/tinycthread.c'
endif
]
vkh_shared_library = shared_library('vkh',
- c_args: [vkh_compile_options, '-DVKH_SHARED_BUILD'],
- cpp_args: [vkh_compile_options, '-DVKH_SHARED_BUILD'],
+ c_args: [vkh_compile_options, has_c11_threads_support_defines, '-DVKH_SHARED_BUILD'],
+ cpp_args: [vkh_compile_options, has_c11_threads_support_defines, '-DVKH_SHARED_BUILD'],
build_by_default: true,
install: true,
soversion: lib_so_version,
)
vkh_static_library = static_library('vkh',
- c_args: [vkh_compile_options, '-DVKH_STATIC_BUILD'],
- cpp_args: [vkh_compile_options, '-DVKH_STATIC_BUILD'],
+ c_args: [vkh_compile_options, has_c11_threads_support_defines, '-DVKH_STATIC_BUILD'],
+ cpp_args: [vkh_compile_options, has_c11_threads_support_defines, '-DVKH_STATIC_BUILD'],
build_by_default: true,
install: true,
sources: vkh_src,
distribution.
*/
+#if defined(STDC_VERSION) && (STDC_VERSION >= 201102L) && !defined(STDC_NO_THREADS)
/* 2013-01-06 Camilla Löwy <elmindreda@glfw.org>
*
* Added casts from time_t to DWORD to avoid warnings on VC++.
return 0;
}
#endif // _TTHREAD_EMULATE_CLOCK_GETTIME_
-
+#endif // END OF STDC_NO_THREADS
\ No newline at end of file
#ifndef _TINYCTHREAD_H_
#define _TINYCTHREAD_H_
-
+#if defined(STDC_VERSION) && (STDC_VERSION >= 201102L) && !defined(STDC_NO_THREADS)
/**
* @file
* @mainpage TinyCThread API Reference
*/
int tss_set(tss_t key, void *val);
-
-#endif /* _TINYTHREAD_H_ */
-
+#else
+#include <threads.h>
+#endif
+#endif /* _TINYTHREAD_H_ */
\ No newline at end of file