Mail Archives: djgpp-workers/2000/07/30/17:57:39
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 -