diff --git a/src/xpdev/dirwrap.h b/src/xpdev/dirwrap.h
index f903ac8d61f7a8c48eafee1a0dc2934f8843f072..e93d10b7e977477109da3ee9e3f94e23341c3c9e 100644
--- a/src/xpdev/dirwrap.h
+++ b/src/xpdev/dirwrap.h
@@ -65,8 +65,12 @@ extern "C" {
 #else	
 
 	#define ALLFILES "*.*"	/* matches all files in a directory */
-	#define MKDIR(dir)		_mkdir(dir)
-	#define FULLPATH(a,r,l)	_fullpath(a,r,l)
+	#ifdef __WATCOMC__
+		#define MKDIR(dir)		mkdir(dir)
+	#else
+		#define MKDIR(dir)		_mkdir(dir)
+	#endif
+	#define FULLPATH(a,r,l)		_fullpath(a,r,l)
 
 	/* glob-compatible findfirst/findnext wrapper */
 
diff --git a/src/xpdev/genwrap.c b/src/xpdev/genwrap.c
index 18e0f72e9d1670b9704e6550049d4094f16fe3ae..c0bfc636962fbb2dc54600e76aed48f062c0dafd 100644
--- a/src/xpdev/genwrap.c
+++ b/src/xpdev/genwrap.c
@@ -155,7 +155,7 @@ int DLLCALL xp_random(int n)
 /* Return ASCII string representation of ulong								*/
 /* There may be a native GNU C Library function to this...					*/
 /****************************************************************************/
-#if !defined _MSC_VER && !defined __BORLANDC__
+#if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__WATCOMC__)
 char* DLLCALL ultoa(ulong val, char* str, int radix)
 {
 	switch(radix) {
diff --git a/src/xpdev/genwrap.h b/src/xpdev/genwrap.h
index 991e0221503a7ccd22120f4f4277bb59a3f0f006..52e5098c3fb0fd0fc05dbf938c2316a4d5b23db6 100644
--- a/src/xpdev/genwrap.h
+++ b/src/xpdev/genwrap.h
@@ -69,6 +69,11 @@ extern "C" {
 	#define DESCRIBE_COMPILER(str) sprintf(str,"GCC %u.%02u" \
 		,__GNUC__,__GNUC_MINOR__);
 
+#elif defined(__WATCOMC__)
+
+	#define DESCRIBE_COMPILER(str) sprintf(str,"WATC %d" \
+		,__WATCOMC__);
+
 #else /* Unknown compiler */
 
 	#define DESCRIBE_COMPILER(str) strcpy(str,"UNKNOWN COMPILER");
@@ -109,7 +114,11 @@ extern "C" {
 	#define vsnprintf		_vsnprintf
 #endif
 
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
+#if defined(__WATCOMC__)
+	#define vsnprintf(s,l,f,a)	vsprintf(s,f,a)
+#endif
+
+#if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__WATCOMC__)
 	DLLEXPORT char* DLLCALL ultoa(ulong, char*, int radix);
 #endif