Borland and Watcom BOOL type

> I am using Borland C++ 4.52, I have downloaded libwww5.1m with the
Command Line 
> tool.  I cannot seem to compile the program with this compiler.. any
> advice?

The most common problem with Borland and Watcom C compilers is the lack
of support for the boolean type. I don't know for sure whether libwww
uses it. A way to work around it is something like (borrowed from
SIDplay source code, file mytypes.h):

// A user defined ``bool'' type for compilers that don't yet support
one.
//
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) ||
defined(__WATCOMC__)
  #define DONT_HAVE_BOOL_TYPE
#endif

// A ``bool'' type for compilers that don't yet support one.
#if defined(DONT_HAVE_BOOL_TYPE)
  typedef char bool;

  #ifdef true
    #warning Better check include file ``mytypes.h''.
    #undef true
  #endif
  #define true 1

  #ifdef false
    #warning Better check include file ``mytypes.h''.
    #undef false
  #endif
  #define false 0
#endif


// These are also quite common.
#ifdef TRUE
  #warning Better check include file ``mytypes.h''.
  #undef TRUE
#endif
#define TRUE 1

#ifdef FALSE
  #warning Better check include file ``mytypes.h''.
  #undef FALSE
#endif
#define FALSE 0

If you want the complete example (this program is EXTREMELY portable!)
look it up at:
http://www.geocities.com/SiliconValley/Lakes/5147/download.html go to
Linux, SIDplay base distribution get the tgz file.

Yours
Linus Walleij

Received on Friday, 31 July 1998 03:46:39 UTC