Skip to content

Instantly share code, notes, and snippets.

@deltaluca
Created June 23, 2013 13:08
Show Gist options
  • Save deltaluca/5844993 to your computer and use it in GitHub Desktop.
Save deltaluca/5844993 to your computer and use it in GitHub Desktop.
patch for hxcpp CFFILoader for buffer_data and val_array_set_size on neko.
Index: include/hx/CFFILoader.h
===================================================================
--- include/hx/CFFILoader.h (revision 744)
+++ include/hx/CFFILoader.h (working copy)
@@ -101,7 +101,7 @@
if (!sNekoDllHandle)
sNekoDllHandle = dlopen("libneko." NEKO_EXT ".0", RTLD_NOW);
#endif
-
+
if (!sNekoDllHandle)
{
fprintf(stderr,"Could not link to neko.\n");
@@ -226,7 +226,7 @@
// Byte arrays
-neko_buffer api_val_to_buffer(neko_value arg1) { return dyn_alloc_buffer(api_val_string(arg1)); }
+neko_buffer api_val_to_buffer(neko_value arg1) { return dyn_alloc_buffer(api_val_string(arg1)); }
neko_buffer api_alloc_buffer_len(int inLen)
@@ -269,6 +269,7 @@
char * api_buffer_data(neko_buffer inBuffer)
{
return (char *)api_val_string(dyn_val_field((neko_value)inBuffer,b_id));
+// return (char*)api_val_string(dyn_val_buffer(inBuffer));
}
@@ -407,7 +408,7 @@
void api_val_array_set_size(neko_value arg1,int inLen)
{
- NOT_IMPLEMNETED("api_val_array_set_size");
+ dyn_val_ocall1(arg1,dyn_val_id("__grow"),neko_alloc_int(inLen));
}
void api_val_array_push(neko_value inArray,neko_value inValue)
@@ -607,7 +608,7 @@
#ifdef NEKO_WINDOWS
-
+
void *LoadFunc(const char *inName)
{
#ifndef HX_WINRT
@@ -679,8 +680,8 @@
#endif
#endif // not static link
-
+
#ifndef ANDROID
#define DEFFUNC(name,ret,def_args,call_args) \
@@ -697,7 +698,7 @@
return name call_args; \
}\
FUNC_##name name = IMPL_##name;
-
+
#ifdef NEKO_COMPATIBLE
DEFINE_PRIM(neko_init,5)
#endif
@@ -718,8 +719,8 @@
return name call_args; \
}\
FUNC_##name name = IMPL_##name;
-
+
#endif
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment