Add Windows support. (#2306)
JerryScript-DCO-1.0-Signed-off-by: PKarics karicska@gmail.com JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
This commit is contained in:
@@ -47,6 +47,24 @@ extern "C"
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
/*
|
||||
* Compiler-specific macros relevant for Microsoft Visual C/C++ Compiler.
|
||||
*/
|
||||
#define JERRY_ATTR_DEPRECATED __declspec(deprecated)
|
||||
#define JERRY_ATTR_NOINLINE __declspec(noinline)
|
||||
#define JERRY_ATTR_NORETURN __declspec(noreturn)
|
||||
|
||||
/*
|
||||
* Microsoft Visual C/C++ Compiler doesn't support for VLA, using _alloca
|
||||
* instead.
|
||||
*/
|
||||
void * __cdecl _alloca (size_t _Size);
|
||||
#define JERRY_VLA(type, name, size) type *name = (type *) (_alloca (sizeof (type) * size))
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/*
|
||||
* Default empty definitions for all compiler-specific macros. Define any of
|
||||
* these in a guarded block above (e.g., as for GCC) to fine tune compilation
|
||||
@@ -110,6 +128,10 @@ extern "C"
|
||||
#define JERRY_UNLIKELY(x) (x)
|
||||
#endif /* !JERRY_UNLIKELY */
|
||||
|
||||
#ifndef JERRY_VLA
|
||||
#define JERRY_VLA(type, name, size) type name[size]
|
||||
#endif /* !JERRY_VLA */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user