  
  #include "dynload.h"
  #include "dynload_alloc.h"
-@@ -39,15 +40,16 @@
- 
- #if defined(ARCH_X64)
+@@ -40,15 +41,16 @@
+ 
+ #if defined(ARCH_X64) //@@@ use dyncall_macros.h
  #define MACH_HEADER_TYPE mach_header_64
 +#define MACH_MAGIC MH_MAGIC_64
  #define SEGMENT_COMMAND segment_command_64

 	dlFreeMem(pSyms);
 }
 
@@ -132,6 +305,11 @@
 	if (nl->n_un.n_strx <= 1)
 		return NULL; // would be empty string anyway
 	

 struct DLLib_
 {
 	char* libPath;
@@ -58,11 +60,139 @@
 
 struct DLSyms_
 {
