Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added C helper code

  • Loading branch information...
commit 0269db57f60b578eb30e426680528b71f1303e8c 1 parent f342267
@FROGGS FROGGS authored
Showing with 30 additions and 0 deletions.
  1. +11 −0 lib/SDL/CompileTestLib.pm
  2. +19 −0 lib/SDL/memcopy.c
View
11 lib/SDL/CompileTestLib.pm
@@ -0,0 +1,11 @@
+module SDL::CompileTestLib;
+
+sub compile_test_lib( $name ) is export {
+ my $o = $*VM<config><o>;
+ my $so = $*VM<config><load_ext>;
+ my $c_line = "$*VM<config><cc> -c $*VM<config><cc_shared> $*VM<config><cc_o_out>$name$o $*VM<config><ccflags> $name.c";
+ my $l_line = "$*VM<config><ld> $*VM<config><ld_load_flags> $*VM<config><ldflags> " ~
+ "$*VM<config><libs> $*VM<config><ld_out>$name$so $name$o";
+ shell($c_line);
+ shell($l_line);
+}
View
19 lib/SDL/memcopy.c
@@ -0,0 +1,19 @@
+#include <string.h>
+
+#ifdef WIN32
+#define DLLEXPORT __declspec(dllexport)
+#else
+#define DLLEXPORT extern
+#endif
+
+DLLEXPORT void *GetBuf( const void *from, void *to, size_t len )
+{
+ return memcpy( to, from, len );
+}
+
+DLLEXPORT void *GetPointer( size_t len )
+{
+ return (void *)len;
+}
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.