This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Predefining __OS_DOS__



  In message <19981211014146.J166@esmeralda.gerwinski.de>you write:
  > In most other cases I would agree, but ports of GNU software to
  > MS-DOS-like systems have always been somewhat special rather
  > than part of the main line.
True.  And if you read GNU policy on being DOS friendly you'll find that
policy discourages catering to DOS braindamage.  I agree with that policy.
MS DOS is not a priority.


  > identifying all MS-DOS-like systems.)  I think it's time to
  > clean them up, and a common predefinition for all MS-DOS-like
  > systems is a step forward in this direction.
I disagree strongly that this is a step forward, it sounds much more
like a step backwards to me.  It is not the compiler's job to try and predefine
"commonizing" symbols, nor should it be.

Code that needs to be dos-aware should check for the specific systems that
are dos-like using the existing predefines for each system.

  > BTW, does anyone know whether autoconf works on MS-DOS?
Unsure, but we can (and should) have the dos configurations emulate what
autoconf does if autoconf can not run on DOS.  ie, there are a set of things
autoconf defines based on characteristics of the host.  A DOS host would
use the same defines, but would generate them statically (or by running some
batch script).

This allows DOS hosts to appear to work much more like other hosts, which
allows us to support them in a reasonable fashion.

We need to move away from thinking about specific host systems and toward
thinking about how to write code which deals with characteristics of host
systems.  It's a subtle, but important distinction.

Instead of writing 

#ifdef DOS
do dos-like stuff
#endif

You write

#ifdef HAVE_SOME_FEATURE
do code to handle that feature
#endif

  > >   > This is confusing for Pascal programmers since there is no
  > >   > symbol `||' in Pascal.
  > > But there's also no #ifdef in Pascal.  If they can learn about #ifdef,
  > > #define and friends, they can learn about ||. :-)
  > 
  > There is (*$ifdef FOO *), (*$define FOO *), but no `||' in
  > Pascal.  (In fact GNU Pascal does support `||' because its
  > preprocessor is a modified `cpp', but I consider C expressions
  > in a Pascal preprocessor a bug, not a feature, and I am not
  > planning to encourage their use in Pascal programs.)
So, write a set of nested #ifdefs.  ANything you do with "||" can be done
with a nest.  Though I would encourage "||" for use in cpp macros.

There's no reason to confine Pascal to an inferior preprocessor.


jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]