Commit 15ecd02f authored by rswindell's avatar rswindell
Browse files

Added Watcom C/C++ support.

parent 82163c4f
......@@ -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 */
......
......@@ -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) {
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment