[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tim-3] Improved DJGPP support in src/files.c
From: |
Paul Eggert |
Subject: |
Re: [tim-3] Improved DJGPP support in src/files.c |
Date: |
Tue, 15 Jan 2002 10:07:24 -0800 (PST) |
> From: Akim Demaille <address@hidden>
> Date: 15 Jan 2002 18:41:42 +0100
> | OK - below is a draft of a new header in lib/ (slash.h) that defines the
> | necessary things.
There's already a header dirname.h that does much of the same thing. See:
ftp://alpha.gnu.org/gnu/fetish/fileutils-4.1.5.tar.gz
How about if we simply upgrade bison's dirname.h to that, possibly
with some improvements?
> | I'd also like to place the PARAMS macro in its own
> | little header file; it's currently duplicated in several places...
I'm of two minds about this. Part of me wants K&R C go away. K&R C
is no longer supported by many GNU applications. I've dropped support
for it on all the apps that I am the principal maintainer for, and
have not received one complaint. There are some holdout apps, but I
suspect they'll give up on K&R C sooner or later. In the meantime,
perhaps it's better if we just replicate PARAMS everywhere rather than
codify it into a separate little tiny file that will go away one of
these days anyway.
> | #if !defined(ISSLASH)
> | # if defined(WIN32) || defined(__DJGPP__)
> | # if defined(__GNUC__)
> | # define ISSLASH(C) ({typeof(C) __c = C; (__c == '/' || __c == '\\');
> | })
> | # else
> | /* FIXME: This evaluates C twice! */
> | # define ISSLASH(C) ((C) == '/' || (C) == '\\')
> | # endif
> | # elif defined(MSDOS)
> | # define ISSLASH(C) ((C) == '\\')
> | # else
> | # define ISSLASH(C) ((C) == '/')
> | # endif
> | #endif
I'd rather not put this stuff in the mainline code, as it complicates
it unnecessarily. I would rather have something like this:
#ifndef ISSLASH
# define ISSLASH(C) ((C) == '/')
#endif
and then let config.h override it. Similarly for FILESYSTEM_PREFIX_LEN.
Again, please see dirname.h in fileutils 4.1.5.
> | #define BACKSLASH_IS_PATH_SEPARATOR ISSLASH ('\\')
This macro seems to me to be unnecessary. (Should we have
COLON_IS_PATH_SEPARATOR for the Mac? :-) I am a bit suspicious of
`#define X Y' where there is only one reasonable value for Y and where
Y is shorter than X.
> Hm, that's not what I had in mind. My idea was introducing an
> Autoconf macro that would ac_define IS_SLASH and the others. It
> seemed like the right idea to me (you know we are somewhat against
> #ifdef _MY_SYSTEM_TAG :).
Yes, I'd rather head in that direction too.
- [tim-3] Improved DJGPP support in src/files.c, Tim Van Holder, 2002/01/06
- Re: [tim-3] Improved DJGPP support in src/files.c, Akim Demaille, 2002/01/07
- Re: [tim-3] Improved DJGPP support in src/files.c, Akim Demaille, 2002/01/11
- Re: [tim-3] Improved DJGPP support in src/files.c, Tim Van Holder, 2002/01/11
- Re: [tim-3] Improved DJGPP support in src/files.c, Akim Demaille, 2002/01/11
- Re: [tim-3] Improved DJGPP support in src/files.c, Tim Van Holder, 2002/01/11
- Re: [tim-3] Improved DJGPP support in src/files.c, Tim Van Holder, 2002/01/13
- Re: [tim-3] Improved DJGPP support in src/files.c, Akim Demaille, 2002/01/15
- Re: [tim-3] Improved DJGPP support in src/files.c,
Paul Eggert <=
- Re: [tim-3] Improved DJGPP support in src/files.c, Tim Van Holder, 2002/01/15
- Re: [tim-3] Improved DJGPP support in src/files.c, Paul Eggert, 2002/01/15
- Re: [tim-3] Improved DJGPP support in src/files.c, Tim Van Holder, 2002/01/16
- Re: [tim-3] Improved DJGPP support in src/files.c, Paul Eggert, 2002/01/16
- Re: [tim-3] Improved DJGPP support in src/files.c, Tim Van Holder, 2002/01/16
- Re: [tim-3] Improved DJGPP support in src/files.c, Paul Eggert, 2002/01/16
- Re: [tim-3] Improved DJGPP support in src/files.c, Akim Demaille, 2002/01/17
- Re: [tim-3] Improved DJGPP support in src/files.c, Paul Eggert, 2002/01/17
- Re: [tim-3] Improved DJGPP support in src/files.c, Akim Demaille, 2002/01/21
- Re: [tim-3] Improved DJGPP support in src/files.c, Akim Demaille, 2002/01/17