W3C home > Mailing lists > Public > www-lib@w3.org > July to September 1998

Borland and Watcom BOOL type

From: <Linus.Walleij@ecs.ericsson.se>
Date: Fri, 31 Jul 1998 09:45:30 +0200
To: www-lib@w3.org
Message-id: <81314DE3B27DD0119A7400609719CF4B02CAEB20@eseldnt100.ericsson.se>
> 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
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) ||

// 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
  #define true 1

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

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

#ifdef FALSE
  #warning Better check include file ``mytypes.h''.
  #undef FALSE
#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.

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:48 UTC