diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/argument.h | 21 | ||||
-rw-r--r-- | include/array.h | 8 | ||||
-rw-r--r-- | include/platform.h | 27 | ||||
-rw-r--r-- | include/value.h | 6 |
4 files changed, 61 insertions, 1 deletions
diff --git a/include/argument.h b/include/argument.h index ddb6390..f45a43a 100644 --- a/include/argument.h +++ b/include/argument.h @@ -144,10 +144,31 @@ private: }; /** + * Old Visual C++ environments do not support initializer lists + */ +#if defined(_MSC_VER) && _MSC_VER < 1800 + +/** + * For old visual c++ compilers, arguments should be passed as vectors + */ +using Arguments = std::vector<Argument>; + +/** + * Other compilers, and visual C++ 2013 do support initializer lists + */ +#else + +/** * A list of arguments can be supplied to methods * @type Arguments */ using Arguments = std::initializer_list<Argument>; + +/** + * End of visual C++ check + */ +#endif + /** * End of namespace diff --git a/include/array.h b/include/array.h index 882670a..02fe4c4 100644 --- a/include/array.h +++ b/include/array.h @@ -57,12 +57,18 @@ public: */ template <typename T> Array(const std::map<std::string,T> &value) : Value(value) {} - + +// old visual c++ environments have no support for initializer lists +# if !defined(_MSC_VER) || _MSC_VER >= 1800 + /** * Constructor from an initializer list * @param value */ Array(const std::initializer_list<Value> &value) : Value(value) {} + +// end of visual c++ check +# endif /** * Destructor diff --git a/include/platform.h b/include/platform.h new file mode 100644 index 0000000..561cd60 --- /dev/null +++ b/include/platform.h @@ -0,0 +1,27 @@ +/** + * Platform.h + * + * Macro that we use to find out whether we run on 64bit or 32bit + * platforms. + * + * @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com> + * @copyright 2015 Copernica BV + */ + +// Check windows +#if _WIN32 || _WIN64 +#if _WIN64 +#define PHPCPP_64BIT +#else +#define PHPCPP_32BIT +#endif +#endif + +// Check GCC and clang +#if __GNUC__ || __clang__ +#if __x86_64__ || __ppc64__ +#define PHPCPP_64BIT +#else +#define PHPCPP_32BIT +#endif +#endif diff --git a/include/value.h b/include/value.h index b87574b..2440532 100644 --- a/include/value.h +++ b/include/value.h @@ -81,6 +81,9 @@ public: for (auto &elem : input) setRaw(i++, elem); } + // old visual c++ environments have no support for initializer lists +# if !defined(_MSC_VER) || _MSC_VER >= 1800 + /** * Constructor from an initializer list * @param value @@ -94,6 +97,9 @@ public: // set all elements for (auto &elem : value) setRaw(i++, elem); } + + // end of visual c++ check +# endif /** * Constructor from a map (this will create an associative array) |