summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-08-29 10:24:41 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-08-29 10:24:41 +0200
commit856aaf9880848cab154189a36e33d4d10e3da185 (patch)
tree944174ef4046a5af0f27d4d7142aa72b82f8c2f5
parentcb6808285bb0e41f90245e568951ee24b6a5faf2 (diff)
parent780fde0f4c07920c210cc45ef0c5e4b05f81c76f (diff)
Merge pull request #128 from andot/vs2013
Fixed compatibility issue with VS2013
-rw-r--r--include/base.h8
-rw-r--r--include/exception.h4
-rw-r--r--include/ini.h4
-rw-r--r--phpcpp.h1
-rw-r--r--zend/includes.h1
-rw-r--r--zend/objectimpl.h12
-rw-r--r--zend/super.cpp4
7 files changed, 22 insertions, 12 deletions
diff --git a/include/base.h b/include/base.h
index 87c7483..f5ebed1 100644
--- a/include/base.h
+++ b/include/base.h
@@ -87,7 +87,7 @@ public:
*/
Value operator[](const char *name) const
{
- return Value(this)[name];
+ return Value(this).get(name);
}
/**
@@ -97,7 +97,7 @@ public:
*/
Value operator[](const std::string &name) const
{
- return Value(this)[name];
+ return Value(this).get(name);
}
/**
@@ -107,7 +107,7 @@ public:
*/
Value property(const char *name) const
{
- return Value(this)[name];
+ return Value(this).get(name);
}
/**
@@ -117,7 +117,7 @@ public:
*/
Value property(const std::string &name) const
{
- return Value(this)[name];
+ return Value(this).get(name);
}
/**
diff --git a/include/exception.h b/include/exception.h
index aff0afc..94aaa85 100644
--- a/include/exception.h
+++ b/include/exception.h
@@ -52,7 +52,11 @@ public:
* Overridden what method
* @return const char *
*/
+#ifdef _NOEXCEPT
+ virtual const char *what() const _NOEXCEPT override
+#else
virtual const char *what() const noexcept override
+#endif
{
return _message.c_str();
}
diff --git a/include/ini.h b/include/ini.h
index 1d881e9..69137a2 100644
--- a/include/ini.h
+++ b/include/ini.h
@@ -125,7 +125,11 @@ private:
* @param value
* @return string
*/
+#ifdef _MSC_VER
+ static const char* bool2str(const bool value)
+#else
static constexpr const char* bool2str(const bool value)
+#endif
{
// cast to a string
return ( static_cast<bool>(value) ? "On" : "Off");
diff --git a/phpcpp.h b/phpcpp.h
index baa91cc..23efe69 100644
--- a/phpcpp.h
+++ b/phpcpp.h
@@ -22,6 +22,7 @@
#include <exception>
#include <map>
#include <set>
+#include <functional>
/**
* Include all headers files that are related to this library
diff --git a/zend/includes.h b/zend/includes.h
index 63b435e..582530b 100644
--- a/zend/includes.h
+++ b/zend/includes.h
@@ -20,6 +20,7 @@
#include <list>
#include <exception>
#include <type_traits>
+#include <functional>
// for debug
#include <iostream>
diff --git a/zend/objectimpl.h b/zend/objectimpl.h
index 7f16320..d72ddbd 100644
--- a/zend/objectimpl.h
+++ b/zend/objectimpl.h
@@ -98,20 +98,20 @@ public:
// when in thread safety mode, the destruct method and free method have
// an extra parameter holding thread information
- using DestructType = void(zend_object*,unsigned int,void***);
- using FreeType = void(zend_object*,void***);
+ using DestructType = void(*)(zend_object*,unsigned int,void***);
+ using FreeType = void(*)(zend_object*,void***);
#else
// not in thread mode: no special parameter for the tsrm_ls variable
- using DestructType = void(zend_object*,unsigned int);
- using FreeType = void(zend_object*);
+ using DestructType = void(*)(zend_object*, unsigned int);
+ using FreeType = void(*)(zend_object*);
#endif
// store the two destruct methods in temporary vars
- DestructType *destructMethod = &ClassImpl::destructObject;
- FreeType *freeMethod = &ClassImpl::freeObject;
+ DestructType destructMethod = &ClassImpl::destructObject;
+ FreeType freeMethod = &ClassImpl::freeObject;
// the destructor and clone handlers are set to NULL. I dont know why, but they do not
// seem to be necessary...
diff --git a/zend/super.cpp b/zend/super.cpp
index c25efeb..a2fa0a9 100644
--- a/zend/super.cpp
+++ b/zend/super.cpp
@@ -40,7 +40,7 @@ Value Super::operator[](const std::string &key)
Value value(PG(http_globals)[_index]);
// pass on the call
- return value[key];
+ return value.get(key);
}
/**
@@ -61,7 +61,7 @@ Value Super::operator[](const char *key)
Value value(PG(http_globals)[_index]);
// pass on the call
- return value[key];
+ return value.get(key);
}
/**