Disable INIT_FINI unittest on Windows (#3132)

MSVC doesn't support library constructor/destructor, let's disable
the related unittest and clarify the documentation and error messages.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
This commit is contained in:
Csaba Osztrogonác
2019-09-20 10:04:55 +02:00
committed by Dániel Bátyai
parent c05686b668
commit dc44b8b933
4 changed files with 14 additions and 3 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ set(JERRY_EXT_NAME jerry-ext)
project (${JERRY_EXT_NAME} C)
# Optional features
set(FEATURE_INIT_FINI OFF CACHE BOOL "Enable init/fini arrays?")
set(FEATURE_INIT_FINI OFF CACHE BOOL "Enable library constructor/destructor support?")
# Status messages
message(STATUS "FEATURE_INIT_FINI " ${FEATURE_INIT_FINI})
@@ -44,6 +44,10 @@ typedef struct jerryx_native_module_t
* library constructor/destructor support.
*/
#ifdef ENABLE_INIT_FINI
#ifdef _MSC_VER
#error "`FEATURE_INIT_FINI` build flag isn't supported on Windows, because Microsoft Visual C/C++ Compiler \
doesn't support library constructors and destructors."
#endif
#define JERRYX_MODULE_CONSTRUCTOR_ATTRIBUTE __attribute__((constructor))
#define JERRYX_MODULE_DESTRUCTOR_ATTRIBUTE __attribute__((destructor))
#define JERRYX_MODULE_REGISTRATION_QUALIFIER static