delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/07/30/17:57:39

Sender: bkorb AT sco DOT COM
Message-ID: <39849CAA.58977AD5@sco.com>
Date: Sun, 30 Jul 2000 14:22:50 -0700
From: Bruce Korb <bkorb AT sco DOT COM>
Organization: Santa Cruz Operations
X-Mailer: Mozilla 4.7 [en] (X11; I; SCO_SV 3.2 i386)
X-Accept-Language: en
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: DJ Delorie <dj AT delorie DOT com>, djgpp-workers AT delorie DOT com, bkorb AT sco DOT COM
Subject: Re: DJGPP patch for fixincludes
References: <397DCC3F DOT 32D9BB7C AT sco DOT com> <200007281731 DOT UAA10498 AT mailgw1 DOT netvision DOT net DOT il> <200007281738 DOT NAA09572 AT envy DOT delorie DOT com> <200007290638 DOT JAA27818 AT mailgw3 DOT netvision DOT net DOT il>
Reply-To: djgpp-workers AT delorie DOT com

Eli Zaretskii wrote:
> Bruce, was fixincl supposed to fix NULL?  I don't think so, but
> perhaps I overlooked some test.
> 
> We could always add a fix if we want to, though.

This is the fix for NULL and it is tested on every
header:

  /*
   *  Fix multiple defines for NULL.  Sometimes, we stumble into \r\n
   *  terminated lines, so accommodate these.  Test both ways.
   */
  fix = {
    hackname  = undefine_null;
    select    = "^#[ \t]*define[ \t]+NULL[ \t]";
    bypass    = "#[ \t]*(ifn|un)def[ \t]+NULL($|[ \t\r])";

    c_fix     = format;
    c_fix_arg = "#ifndef NULL%2\n#define NULL%1%2\n#endif%2\n";
    c_fix_arg = "^#[ \t]*define[ \t]*[ \t]NULL([^\r\n]+)([\r]*)\n";

    test_text = "#define NULL 0UL\r\n#define NULL\t((void*)0)\n";
  };

Most likely, the "bypass" clause is triggered on all
your headers that define NULL.  If it should not have triggered,
then there is a bug.  However, we we need to test this stuff
with make check on a regular box anyway.  I propose the following
additions:

1.  The MSDOS case element in mkfixinc.sh should be something like:

	${MAKE} -f ${srcdir}/make.dos install
	exit $?

2.  There should be a new source file "make.dos" with the default
    be to build the two __MSDOS__ defined executables (regardless
    of platform) and an "install" target that copies fixincl.sh and
    fixincl into position (the directory "..").

3.  check.tpl should be augmented so that after the regular fixincl
    goes through its paces, the __MSDOS__ flavor is built and run
    against the one header, "testing.h".  Test that the output is
    correct.  That should test the operation of the DOS  version.
    That ought to be enough.

Regards,
	Bruce

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019