Last active
June 12, 2016 18:05
-
-
Save ng420/358f385a4b99fea35e498a0f11c9b0fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
#include "circle.h" | |
#define M_PI 3.14159 | |
int Circle::area() { | |
cout<<"Circle::area called"<<endl; | |
return M_PI*r*r; | |
} | |
void pnt(Circle *c) { | |
cout << sizeof(*c) << endl; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Circle | |
{ | |
private: | |
int r; | |
public: | |
int area(); | |
}; | |
void pnt(Circle *); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/nishant/swig-hhvm/class/ext_example.cpp: In function ‘HPHP::Resource HPHP::_wrap_new_Circle()’: | |
/home/nishant/swig-hhvm/class/ext_example.cpp:185:37: error: no matching function for call to ‘make(Circle*&)’ | |
tresult = req::make<Circle>(result); | |
^ | |
/home/nishant/swig-hhvm/class/ext_example.cpp:185:37: note: candidates are: | |
In file included from /usr/local/include/hphp/runtime/base/tv-helpers.h:20:0, | |
from /usr/local/include/hphp/runtime/base/type-variant.h:22, | |
from /usr/local/include/hphp/runtime/base/ini-setting.h:20, | |
from /usr/local/include/hphp/runtime/ext/extension.h:22, | |
from /home/nishant/swig-hhvm/class/ext_example.cpp:159: | |
/usr/local/include/hphp/runtime/base/object-data.h:534:9: note: template<class T, class ... Args> typename std::enable_if<std::is_convertible<T*, HPHP::ObjectData*>::value, HPHP::req::ptr<T> >::type HPHP::req::make(Args&& ...) | |
>::type make(Args&&... args) { | |
^ | |
/usr/local/include/hphp/runtime/base/object-data.h:534:9: note: template argument deduction/substitution failed: | |
/usr/local/include/hphp/runtime/base/object-data.h: In substitution of ‘template<class T, class ... Args> typename std::enable_if<std::is_convertible<T*, HPHP::ObjectData*>::value, HPHP::req::ptr<T> >::type HPHP::req::make(Args&& ...) [with T = Circle; Args = {}]’: | |
/home/nishant/swig-hhvm/class/ext_example.cpp:185:37: required from here | |
/usr/local/include/hphp/runtime/base/object-data.h:534:9: error: no type named ‘type’ in ‘struct std::enable_if<false, HPHP::req::ptr<Circle> >’ | |
In file included from /usr/local/include/hphp/runtime/base/tv-helpers.h:22:0, | |
from /usr/local/include/hphp/runtime/base/type-variant.h:22, | |
from /usr/local/include/hphp/runtime/base/ini-setting.h:20, | |
from /usr/local/include/hphp/runtime/ext/extension.h:22, | |
from /home/nishant/swig-hhvm/class/ext_example.cpp:159: | |
/usr/local/include/hphp/runtime/base/resource-data.h:296:9: note: template<class T, class ... Args> typename std::enable_if<std::is_convertible<T*, HPHP::ResourceData*>::value, HPHP::req::ptr<T> >::type HPHP::req::make(Args&& ...) | |
>::type make(Args&&... args) { | |
^ | |
/usr/local/include/hphp/runtime/base/resource-data.h:296:9: note: template argument deduction/substitution failed: | |
/usr/local/include/hphp/runtime/base/resource-data.h: In substitution of ‘template<class T, class ... Args> typename std::enable_if<std::is_convertible<T*, HPHP::ResourceData*>::value, HPHP::req::ptr<T> >::type HPHP::req::make(Args&& ...) [with T = Circle; Args = {}]’: | |
/home/nishant/swig-hhvm/class/ext_example.cpp:185:37: required from here | |
/usr/local/include/hphp/runtime/base/resource-data.h:296:9: error: no type named ‘type’ in ‘struct std::enable_if<false, HPHP::req::ptr<Circle> >’ | |
In file included from /usr/local/include/hphp/runtime/base/type-string.h:20:0, | |
from /usr/local/include/hphp/runtime/base/debuggable.h:19, | |
from /usr/local/include/hphp/runtime/ext/extension.h:21, | |
from /home/nishant/swig-hhvm/class/ext_example.cpp:159: | |
/usr/local/include/hphp/runtime/base/req-ptr.h: In instantiation of ‘static void HPHP::req::ptr<T>::decRefPtr(T*) [with T = Circle]’: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:72:19: required from ‘HPHP::req::ptr<T>::~ptr() [with T = Circle]’ | |
/home/nishant/swig-hhvm/class/ext_example.cpp:173:40: required from here | |
/usr/local/include/hphp/runtime/base/req-ptr.h:175:33: error: ‘class Circle’ has no member named ‘decRefAndRelease’ | |
if (LIKELY(ptr != nullptr)) ptr->decRefAndRelease(); | |
^ | |
/usr/local/include/hphp/runtime/base/req-ptr.h: In instantiation of ‘HPHP::req::ptr<T> HPHP::unsafe_cast_helper<T, P>::operator()(const P&) const [with T = Circle; P = HPHP::Resource]’: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:312:61: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:370:63: required from ‘HPHP::req::ptr<T> HPHP::dyn_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/home/nishant/swig-hhvm/class/ext_example.cpp:173:40: required from here | |
/usr/local/include/hphp/runtime/base/req-ptr.h:305:50: error: no matching function for call to ‘deref(const HPHP::Resource&)’ | |
return req::ptr<T>(static_cast<T*>(deref<T>(p))); | |
^ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:305:50: note: candidates are: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:219:11: note: template<class T> T* HPHP::deref(const HPHP::req::ptr<T>&) | |
inline T* deref(const req::ptr<T>& p) { return p.get(); } | |
^ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:219:11: note: template argument deduction/substitution failed: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:305:50: note: cannot convert ‘p’ (type ‘const HPHP::Resource’) to type ‘const HPHP::req::ptr<Circle>&’ | |
return req::ptr<T>(static_cast<T*>(deref<T>(p))); | |
^ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:222:17: note: template<class T> const T* HPHP::deref(const T*) | |
inline const T* deref(const T* p) { return p; } | |
^ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:222:17: note: template argument deduction/substitution failed: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:305:50: note: cannot convert ‘p’ (type ‘const HPHP::Resource’) to type ‘const Circle*’ | |
return req::ptr<T>(static_cast<T*>(deref<T>(p))); | |
^ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:250:13: note: template<class T, class P> decltype (P().get()) HPHP::deref(const P&) | |
inline auto deref(const P& p) -> decltype(P().get()) { | |
^ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:250:13: note: template argument deduction/substitution failed: | |
/usr/local/include/hphp/runtime/base/req-ptr.h: In substitution of ‘template<class T, class P> decltype (P().get()) HPHP::deref(const P&) [with T = Circle; P = HPHP::Resource]’: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:305:50: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_helper<T, P>::operator()(const P&) const [with T = Circle; P = HPHP::Resource]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:312:61: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:370:63: required from ‘HPHP::req::ptr<T> HPHP::dyn_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/home/nishant/swig-hhvm/class/ext_example.cpp:173:40: required from here | |
/usr/local/include/hphp/runtime/base/req-ptr.h:250:13: error: ‘struct HPHP::Resource’ has no member named ‘get’ | |
In file included from /usr/local/include/hphp/runtime/base/ini-setting.h:20:0, | |
from /usr/local/include/hphp/runtime/ext/extension.h:22, | |
from /home/nishant/swig-hhvm/class/ext_example.cpp:159: | |
/usr/local/include/hphp/runtime/base/req-ptr.h: In instantiation of ‘HPHP::req::ptr<T> HPHP::unsafe_cast_helper<T, P>::operator()(const P&) const [with T = Circle; P = HPHP::Resource]’: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:312:61: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:370:63: required from ‘HPHP::req::ptr<T> HPHP::dyn_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/home/nishant/swig-hhvm/class/ext_example.cpp:173:40: required from here | |
/usr/local/include/hphp/runtime/base/type-variant.h:984:11: note: template<class T> typename std::enable_if<std::is_base_of<HPHP::ObjectData, T>::value, HPHP::ObjectData*>::type HPHP::deref(const HPHP::Variant&) | |
>::type deref(const Variant& v) { return v.getObjectData(); } | |
^ | |
/usr/local/include/hphp/runtime/base/type-variant.h:984:11: note: template argument deduction/substitution failed: | |
/usr/local/include/hphp/runtime/base/type-variant.h: In substitution of ‘template<class T> typename std::enable_if<std::is_base_of<HPHP::ObjectData, T>::value, HPHP::ObjectData*>::type HPHP::deref(const HPHP::Variant&) [with T = Circle]’: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:305:50: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_helper<T, P>::operator()(const P&) const [with T = Circle; P = HPHP::Resource]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:312:61: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:370:63: required from ‘HPHP::req::ptr<T> HPHP::dyn_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/home/nishant/swig-hhvm/class/ext_example.cpp:173:40: required from here | |
/usr/local/include/hphp/runtime/base/type-variant.h:984:11: error: no type named ‘type’ in ‘struct std::enable_if<false, HPHP::ObjectData*>’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h: In instantiation of ‘HPHP::req::ptr<T> HPHP::unsafe_cast_helper<T, P>::operator()(const P&) const [with T = Circle; P = HPHP::Resource]’: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:312:61: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:370:63: required from ‘HPHP::req::ptr<T> HPHP::dyn_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/home/nishant/swig-hhvm/class/ext_example.cpp:173:40: required from here | |
/usr/local/include/hphp/runtime/base/type-variant.h:978:11: note: template<class T> typename std::enable_if<std::is_base_of<HPHP::ResourceData, T>::value, HPHP::ResourceData*>::type HPHP::deref(const HPHP::Variant&) | |
>::type deref(const Variant& v) { return v.getResourceData(); } | |
^ | |
/usr/local/include/hphp/runtime/base/type-variant.h:978:11: note: template argument deduction/substitution failed: | |
/usr/local/include/hphp/runtime/base/type-variant.h: In substitution of ‘template<class T> typename std::enable_if<std::is_base_of<HPHP::ResourceData, T>::value, HPHP::ResourceData*>::type HPHP::deref(const HPHP::Variant&) [with T = Circle]’: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:305:50: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_helper<T, P>::operator()(const P&) const [with T = Circle; P = HPHP::Resource]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:312:61: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:370:63: required from ‘HPHP::req::ptr<T> HPHP::dyn_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/home/nishant/swig-hhvm/class/ext_example.cpp:173:40: required from here | |
/usr/local/include/hphp/runtime/base/type-variant.h:978:11: error: no type named ‘type’ in ‘struct std::enable_if<false, HPHP::ResourceData*>’ | |
In file included from /usr/local/include/hphp/runtime/base/type-variant.h:26:0, | |
from /usr/local/include/hphp/runtime/base/ini-setting.h:20, | |
from /usr/local/include/hphp/runtime/ext/extension.h:22, | |
from /home/nishant/swig-hhvm/class/ext_example.cpp:159: | |
/usr/local/include/hphp/runtime/base/req-ptr.h: In instantiation of ‘HPHP::req::ptr<T> HPHP::unsafe_cast_helper<T, P>::operator()(const P&) const [with T = Circle; P = HPHP::Resource]’: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:312:61: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:370:63: required from ‘HPHP::req::ptr<T> HPHP::dyn_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/home/nishant/swig-hhvm/class/ext_example.cpp:173:40: required from here | |
/usr/local/include/hphp/runtime/base/type-resource.h:185:11: note: template<class T> typename std::enable_if<std::is_base_of<HPHP::ResourceData, T>::value, HPHP::ResourceData*>::type HPHP::deref(const HPHP::Resource&) | |
>::type deref(const Resource& r) { | |
^ | |
/usr/local/include/hphp/runtime/base/type-resource.h:185:11: note: template argument deduction/substitution failed: | |
/usr/local/include/hphp/runtime/base/type-resource.h: In substitution of ‘template<class T> typename std::enable_if<std::is_base_of<HPHP::ResourceData, T>::value, HPHP::ResourceData*>::type HPHP::deref(const HPHP::Resource&) [with T = Circle]’: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:305:50: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_helper<T, P>::operator()(const P&) const [with T = Circle; P = HPHP::Resource]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:312:61: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:370:63: required from ‘HPHP::req::ptr<T> HPHP::dyn_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/home/nishant/swig-hhvm/class/ext_example.cpp:173:40: required from here | |
/usr/local/include/hphp/runtime/base/type-resource.h:185:11: error: no type named ‘type’ in ‘struct std::enable_if<false, HPHP::ResourceData*>’ | |
In file included from /usr/local/include/hphp/runtime/base/type-variant.h:25:0, | |
from /usr/local/include/hphp/runtime/base/ini-setting.h:20, | |
from /usr/local/include/hphp/runtime/ext/extension.h:22, | |
from /home/nishant/swig-hhvm/class/ext_example.cpp:159: | |
/usr/local/include/hphp/runtime/base/req-ptr.h: In instantiation of ‘HPHP::req::ptr<T> HPHP::unsafe_cast_helper<T, P>::operator()(const P&) const [with T = Circle; P = HPHP::Resource]’: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:312:61: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:370:63: required from ‘HPHP::req::ptr<T> HPHP::dyn_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/home/nishant/swig-hhvm/class/ext_example.cpp:173:40: required from here | |
/usr/local/include/hphp/runtime/base/type-object.h:221:11: note: template<class T> typename std::enable_if<std::is_base_of<HPHP::ObjectData, T>::value, HPHP::ObjectData*>::type HPHP::deref(const HPHP::Object&) | |
>::type deref(const Object& o) { return o.get(); } | |
^ | |
/usr/local/include/hphp/runtime/base/type-object.h:221:11: note: template argument deduction/substitution failed: | |
/usr/local/include/hphp/runtime/base/type-object.h: In substitution of ‘template<class T> typename std::enable_if<std::is_base_of<HPHP::ObjectData, T>::value, HPHP::ObjectData*>::type HPHP::deref(const HPHP::Object&) [with T = Circle]’: | |
/usr/local/include/hphp/runtime/base/req-ptr.h:305:50: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_helper<T, P>::operator()(const P&) const [with T = Circle; P = HPHP::Resource]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:312:61: required from ‘HPHP::req::ptr<T> HPHP::unsafe_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/usr/local/include/hphp/runtime/base/req-ptr.h:370:63: required from ‘HPHP::req::ptr<T> HPHP::dyn_cast_or_null(P&&) [with T = Circle; P = const HPHP::Resource&]’ | |
/home/nishant/swig-hhvm/class/ext_example.cpp:173:40: required from here | |
/usr/local/include/hphp/runtime/base/type-object.h:221:11: error: no type named ‘type’ in ‘struct std::enable_if<false, HPHP::ObjectData*>’ | |
make[2]: *** [CMakeFiles/example.dir/ext_example.cpp.o] Error 1 | |
make[1]: *** [CMakeFiles/example.dir/all] Error 2 | |
make: *** [all] Error 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ---------------------------------------------------------------------------- | |
* This file was automatically generated by SWIG (http://www.swig.org). | |
* Version 3.0.9 | |
* | |
* This file is not intended to be easily readable and contains a number of | |
* coding conventions designed to improve portability and efficiency. Do not make | |
* changes to this file unless you know what you are doing--modify the SWIG | |
* interface file instead. | |
* ----------------------------------------------------------------------------- */ | |
#ifdef __cplusplus | |
/* SwigValueWrapper is described in swig.swg */ | |
template<typename T> class SwigValueWrapper { | |
struct SwigMovePointer { | |
T *ptr; | |
SwigMovePointer(T *p) : ptr(p) { } | |
~SwigMovePointer() { delete ptr; } | |
SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } | |
} pointer; | |
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs); | |
SwigValueWrapper(const SwigValueWrapper<T>& rhs); | |
public: | |
SwigValueWrapper() : pointer(0) { } | |
SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } | |
operator T&() const { return *pointer.ptr; } | |
T *operator&() { return pointer.ptr; } | |
}; | |
template <typename T> T SwigValueInit() { | |
return T(); | |
} | |
#endif | |
/* ----------------------------------------------------------------------------- | |
* This section contains generic SWIG labels for method/variable | |
* declarations/attributes, and other compiler dependent labels. | |
* ----------------------------------------------------------------------------- */ | |
/* template workaround for compilers that cannot correctly implement the C++ standard */ | |
#ifndef SWIGTEMPLATEDISAMBIGUATOR | |
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) | |
# define SWIGTEMPLATEDISAMBIGUATOR template | |
# elif defined(__HP_aCC) | |
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ | |
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ | |
# define SWIGTEMPLATEDISAMBIGUATOR template | |
# else | |
# define SWIGTEMPLATEDISAMBIGUATOR | |
# endif | |
#endif | |
/* inline attribute */ | |
#ifndef SWIGINLINE | |
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) | |
# define SWIGINLINE inline | |
# else | |
# define SWIGINLINE | |
# endif | |
#endif | |
/* attribute recognised by some compilers to avoid 'unused' warnings */ | |
#ifndef SWIGUNUSED | |
# if defined(__GNUC__) | |
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) | |
# define SWIGUNUSED __attribute__ ((__unused__)) | |
# else | |
# define SWIGUNUSED | |
# endif | |
# elif defined(__ICC) | |
# define SWIGUNUSED __attribute__ ((__unused__)) | |
# else | |
# define SWIGUNUSED | |
# endif | |
#endif | |
#ifndef SWIG_MSC_UNSUPPRESS_4505 | |
# if defined(_MSC_VER) | |
# pragma warning(disable : 4505) /* unreferenced local function has been removed */ | |
# endif | |
#endif | |
#ifndef SWIGUNUSEDPARM | |
# ifdef __cplusplus | |
# define SWIGUNUSEDPARM(p) | |
# else | |
# define SWIGUNUSEDPARM(p) p SWIGUNUSED | |
# endif | |
#endif | |
/* internal SWIG method */ | |
#ifndef SWIGINTERN | |
# define SWIGINTERN static SWIGUNUSED | |
#endif | |
/* internal inline SWIG method */ | |
#ifndef SWIGINTERNINLINE | |
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE | |
#endif | |
/* exporting methods */ | |
#if defined(__GNUC__) | |
# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) | |
# ifndef GCC_HASCLASSVISIBILITY | |
# define GCC_HASCLASSVISIBILITY | |
# endif | |
# endif | |
#endif | |
#ifndef SWIGEXPORT | |
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) | |
# if defined(STATIC_LINKED) | |
# define SWIGEXPORT | |
# else | |
# define SWIGEXPORT __declspec(dllexport) | |
# endif | |
# else | |
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) | |
# define SWIGEXPORT __attribute__ ((visibility("default"))) | |
# else | |
# define SWIGEXPORT | |
# endif | |
# endif | |
#endif | |
/* calling conventions for Windows */ | |
#ifndef SWIGSTDCALL | |
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) | |
# define SWIGSTDCALL __stdcall | |
# else | |
# define SWIGSTDCALL | |
# endif | |
#endif | |
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ | |
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) | |
# define _CRT_SECURE_NO_DEPRECATE | |
#endif | |
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ | |
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) | |
# define _SCL_SECURE_NO_DEPRECATE | |
#endif | |
/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ | |
#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) | |
# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 | |
#endif | |
/* Intel's compiler complains if a variable which was never initialised is | |
* cast to void, which is a common idiom which we use to indicate that we | |
* are aware a variable isn't used. So we just silence that warning. | |
* See: https://github.com/swig/swig/issues/192 for more discussion. | |
*/ | |
#ifdef __INTEL_COMPILER | |
# pragma warning disable 592 | |
#endif | |
#include "hphp/runtime/ext/extension.h" | |
#include "hphp/runtime/base/execution-context.h" | |
#include "hphp/runtime/vm/native-data.h" | |
#include "example.h" | |
namespace HPHP { | |
static int64_t _wrap_Circle_area(const Resource& targ1) { | |
Circle *arg1 = (Circle *) 0 ; | |
int64_t tresult ; | |
int result; | |
arg1 = unsafe_cast_or_null<Circle>(targ1).get(); | |
result = (int)(arg1)->area(); | |
tresult = result; | |
return tresult; | |
} | |
static Resource _wrap_new_Circle() { | |
Resource tresult ; | |
Circle *result = 0 ; | |
result = (Circle *)new Circle(); | |
tresult = req::make<Circle>(result); | |
return tresult; | |
} | |
static void _wrap_delete_Circle(const Resource& targ1) { | |
Circle *arg1 = (Circle *) 0 ; | |
arg1 = unsafe_cast_or_null<Circle>(targ1).get(); | |
delete arg1; | |
} | |
static void _wrap_pnt(const Resource& targ1) { | |
Circle *arg1 = (Circle *) 0 ; | |
arg1 = unsafe_cast_or_null<Circle>(targ1).get(); | |
pnt(arg1); | |
} | |
int64_t HHVM_FUNCTION(Circle_area, const Resource& arg1) { | |
return _wrap_Circle_area(arg1); | |
} | |
Resource HHVM_FUNCTION(new_Circle) { | |
return _wrap_new_Circle(); | |
} | |
void HHVM_FUNCTION(delete_Circle, const Resource& arg1) { | |
_wrap_delete_Circle(arg1); | |
} | |
void HHVM_FUNCTION(pnt, const Resource& arg1) { | |
_wrap_pnt(arg1); | |
} | |
class EXAMPLEExtension : public Extension { | |
public: | |
EXAMPLEExtension(): Extension("example", "1.0") {} | |
void moduleInit() override { | |
HHVM_FE(Circle_area); | |
HHVM_FE(new_Circle); | |
HHVM_FE(delete_Circle); | |
HHVM_FE(pnt); | |
loadSystemlib(); | |
} | |
} s_example_extension; | |
HHVM_GET_MODULE(example); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment