diff --git a/xtrn/sdk/xsdk.h b/xtrn/sdk/xsdk.h
index 71aee8315bbd6b8cbc7f407a3989346ff7b4d597..dbdf440b96aba9d3ca079e37a696dd97aeacc75d 100644
--- a/xtrn/sdk/xsdk.h
+++ b/xtrn/sdk/xsdk.h
@@ -59,11 +59,13 @@
 #include <string.h>
 #include <stdlib.h>
 #include <stdarg.h>
-#include <malloc.h>
+#ifndef __FreeBSD__		/* FreeBSD uses stdlib.h for malloc() */
+	#include <malloc.h>
+#endif
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#define GLOBAL extern	/* turns XSDKVAR.C into a header file */
+#define GLOBAL extern	/* turns XSDKVARS.C into a header file */
 #include "xsdkinet.h"
 #include "xsdkwrap.h"
 #include "xsdkvars.c"