Mercurial > hg > octave-kai > gnulib-hg
annotate lib/stdnoreturn.in.h @ 17160:72f4bab621be
fts: introduce FTS_VERBATIM
This gives clients the option to disable stripping of trailing slashes
from input path names during fts_open initialization.
The recent change v0.0-7611-g3a9002d that made fts_open strip trailing
slashes from input path names had a negative impact on findutils that
relies on the old fts_open behavior to implement POSIX requirement that
each path operand of the find utility shall be evaluated unaltered as it
was provided, including all trailing slash characters.
* lib/fts_.h (FTS_VERBATIM): New bit flag.
(FTS_OPTIONMASK, FTS_NAMEONLY, FTS_STOP): Adjust.
* lib/fts.c (fts_open): Honor it.
author | Dmitry V. Levin <ldv@altlinux.org> |
---|---|
date | Sun, 18 Nov 2012 04:40:18 +0400 |
parents | 72cfe53065d1 |
children | e542fd46ad6f |
rev | line source |
---|---|
16388 | 1 /* A substitute for ISO C11 <stdnoreturn.h>. |
2 | |
3 Copyright 2012 Free Software Foundation, Inc. | |
4 | |
5 This program is free software; you can redistribute it and/or modify | |
6 it under the terms of the GNU General Public License as published by | |
7 the Free Software Foundation; either version 2, or (at your option) | |
8 any later version. | |
9 | |
10 This program is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 GNU General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU General Public License | |
16 along with this program; if not, see <http://www.gnu.org/licenses/>. */ | |
17 | |
18 /* Written by Paul Eggert. */ | |
19 | |
20 #ifndef noreturn | |
21 | |
22 /* ISO C11 <stdnoreturn.h> for platforms that lack it. | |
23 | |
24 References: | |
25 ISO C11 (latest free draft | |
26 <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>) | |
27 section 7.23 */ | |
28 | |
29 /* The definition of _Noreturn is copied here. */ | |
30 | |
16508
72cfe53065d1
stdnoreturn: port to MSVC better
Paul Eggert <eggert@cs.ucla.edu>
parents:
16388
diff
changeset
|
31 #if 1200 <= _MSC_VER |
72cfe53065d1
stdnoreturn: port to MSVC better
Paul Eggert <eggert@cs.ucla.edu>
parents:
16388
diff
changeset
|
32 /* Standard include files on this platform contain declarations like |
72cfe53065d1
stdnoreturn: port to MSVC better
Paul Eggert <eggert@cs.ucla.edu>
parents:
16388
diff
changeset
|
33 "__declspec (noreturn) void abort (void);". "#define noreturn |
72cfe53065d1
stdnoreturn: port to MSVC better
Paul Eggert <eggert@cs.ucla.edu>
parents:
16388
diff
changeset
|
34 _Noreturn" would cause this declaration to be rewritten to the |
72cfe53065d1
stdnoreturn: port to MSVC better
Paul Eggert <eggert@cs.ucla.edu>
parents:
16388
diff
changeset
|
35 invalid "__declspec (__declspec (noreturn)) void abort (void);". |
72cfe53065d1
stdnoreturn: port to MSVC better
Paul Eggert <eggert@cs.ucla.edu>
parents:
16388
diff
changeset
|
36 Instead, define noreturn to empty, so that such declarations are |
72cfe53065d1
stdnoreturn: port to MSVC better
Paul Eggert <eggert@cs.ucla.edu>
parents:
16388
diff
changeset
|
37 rewritten to "__declspec () void abort (void);", which is |
72cfe53065d1
stdnoreturn: port to MSVC better
Paul Eggert <eggert@cs.ucla.edu>
parents:
16388
diff
changeset
|
38 equivalent to "void abort (void);"; this gives up on noreturn's |
72cfe53065d1
stdnoreturn: port to MSVC better
Paul Eggert <eggert@cs.ucla.edu>
parents:
16388
diff
changeset
|
39 advice to the compiler but at least it is valid code. */ |
72cfe53065d1
stdnoreturn: port to MSVC better
Paul Eggert <eggert@cs.ucla.edu>
parents:
16388
diff
changeset
|
40 # define noreturn /*empty*/ |
72cfe53065d1
stdnoreturn: port to MSVC better
Paul Eggert <eggert@cs.ucla.edu>
parents:
16388
diff
changeset
|
41 #else |
72cfe53065d1
stdnoreturn: port to MSVC better
Paul Eggert <eggert@cs.ucla.edu>
parents:
16388
diff
changeset
|
42 # define noreturn _Noreturn |
72cfe53065d1
stdnoreturn: port to MSVC better
Paul Eggert <eggert@cs.ucla.edu>
parents:
16388
diff
changeset
|
43 #endif |
16388 | 44 |
45 /* Did he ever return? | |
46 No he never returned | |
47 And his fate is still unlearn'd ... | |
48 -- Steiner J, Hawes BL. M.T.A. (1949) */ | |
49 | |
50 #endif /* noreturn */ |