Skip to content
Snippets Groups Projects
Commit 15ecd02f authored by rswindell's avatar rswindell
Browse files

Added Watcom C/C++ support.

parent 82163c4f
No related branches found
No related tags found
No related merge requests found
...@@ -65,8 +65,12 @@ extern "C" { ...@@ -65,8 +65,12 @@ extern "C" {
#else #else
#define ALLFILES "*.*" /* matches all files in a directory */ #define ALLFILES "*.*" /* matches all files in a directory */
#define MKDIR(dir) _mkdir(dir) #ifdef __WATCOMC__
#define FULLPATH(a,r,l) _fullpath(a,r,l) #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 */ /* glob-compatible findfirst/findnext wrapper */
......
...@@ -155,7 +155,7 @@ int DLLCALL xp_random(int n) ...@@ -155,7 +155,7 @@ int DLLCALL xp_random(int n)
/* Return ASCII string representation of ulong */ /* Return ASCII string representation of ulong */
/* There may be a native GNU C Library function to this... */ /* 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) char* DLLCALL ultoa(ulong val, char* str, int radix)
{ {
switch(radix) { switch(radix) {
......
...@@ -69,6 +69,11 @@ extern "C" { ...@@ -69,6 +69,11 @@ extern "C" {
#define DESCRIBE_COMPILER(str) sprintf(str,"GCC %u.%02u" \ #define DESCRIBE_COMPILER(str) sprintf(str,"GCC %u.%02u" \
,__GNUC__,__GNUC_MINOR__); ,__GNUC__,__GNUC_MINOR__);
#elif defined(__WATCOMC__)
#define DESCRIBE_COMPILER(str) sprintf(str,"WATC %d" \
,__WATCOMC__);
#else /* Unknown compiler */ #else /* Unknown compiler */
#define DESCRIBE_COMPILER(str) strcpy(str,"UNKNOWN COMPILER"); #define DESCRIBE_COMPILER(str) strcpy(str,"UNKNOWN COMPILER");
...@@ -109,7 +114,11 @@ extern "C" { ...@@ -109,7 +114,11 @@ extern "C" {
#define vsnprintf _vsnprintf #define vsnprintf _vsnprintf
#endif #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); DLLEXPORT char* DLLCALL ultoa(ulong, char*, int radix);
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment