summaryrefslogtreecommitdiff
path: root/zend
diff options
context:
space:
mode:
authorRoland Eischer <r.eischer@certec.at>2015-01-26 09:23:36 +0100
committerRoland Eischer <r.eischer@certec.at>2015-01-26 09:25:58 +0100
commit47855f1c68a282903a8db470697915bd419ec17c (patch)
tree29c8eee83ee64edfdf904a55399cf67f0d407078 /zend
parent30eff69a10898dd9b2fb10ed07ae8c68458a5ad2 (diff)
Added macro wrapper for noexcept
- Added macro wrapper for noexcept to support MSVC compiler.
Diffstat (limited to 'zend')
-rw-r--r--zend/includes.h11
-rw-r--r--zend/script.cpp2
-rw-r--r--zend/value.cpp4
3 files changed, 14 insertions, 3 deletions
diff --git a/zend/includes.h b/zend/includes.h
index 874b0b1..93c74ec 100644
--- a/zend/includes.h
+++ b/zend/includes.h
@@ -44,6 +44,17 @@
#define BOOL2SUCCESS(b) ((b) ? SUCCESS : FAILURE)
/**
+ * Macro to be able to support MSVC compiler
+ */
+#ifndef _NOEXCEPT
+# ifndef _MSC_VER
+# define _NOEXCEPT noexecpt
+# else
+# define _NOEXCEPT __declspec(nothrow)
+# endif
+#endif
+
+/**
* Include other files from this library
*/
#include "../include/version.h"
diff --git a/zend/script.cpp b/zend/script.cpp
index 988ab1c..9e1d8f6 100644
--- a/zend/script.cpp
+++ b/zend/script.cpp
@@ -50,7 +50,7 @@ zend_op_array *Script::compile(const char *name, const char *phpcode, size_t siz
* @param script actual PHP code
* @param size length of the string
*/
-Script::Script(const char *name, const char *phpcode, size_t size) noexcept
+Script::Script(const char *name, const char *phpcode, size_t size) _NOEXCEPT
{
// we need the tsrm_ls variable
TSRMLS_FETCH();
diff --git a/zend/value.cpp b/zend/value.cpp
index 8c8cc9a..e021cc1 100644
--- a/zend/value.cpp
+++ b/zend/value.cpp
@@ -285,7 +285,7 @@ Value::Value(const Value &that)
* Move constructor
* @param value
*/
-Value::Value(Value &&that) noexcept: _val(that._val)
+Value::Value(Value &&that) _NOEXCEPT: _val(that._val)
{
// clear the other object
that._val = nullptr;
@@ -396,7 +396,7 @@ int Value::refcount() const
* @param value
* @return Value
*/
-Value &Value::operator=(Value &&value) noexcept
+Value &Value::operator=(Value &&value) _NOEXCEPT
{
// skip self assignment
if (this == &value) return *this;