#ifndef STATIC_LINK #define IMPLEMENT_API #endif #if defined(HX_WINDOWS) || defined(HX_MACOS) || defined(HX_LINUX) // Include neko glue.... #define NEKO_COMPATIBLE #endif #include #include #include #include int addInts(int a, int b) { return a+b; } DEFINE_PRIME2(addInts); void printString(const char *inMessage) { printf("Message : %s.\n", inMessage); } DEFINE_PRIME1v(printString); std::vector roots; void setRoot(int inRoot, value inValue) { if (roots.size()<=inRoot) roots.resize(inRoot+1); if (roots[inRoot]==0) roots[inRoot] = new AutoGCRoot(inValue); else roots[inRoot]->set(inValue); } DEFINE_PRIME2v(setRoot); value getRoot(int inRoot) { if (inRoot>=roots.size() || !roots[inRoot]) return alloc_null(); return roots[inRoot]->get(); } DEFINE_PRIME1(getRoot); void clearRoots() { for(int i=0;i