Mercurial > gnulib
annotate lib/check-version.c @ 40231:9b3c79fdfe0b
strtod: fix clash with strtold
Problem reported for RHEL 5 by Jesse Caldwell (Bug#34817).
* lib/strtod.c (compute_minus_zero, minus_zero):
Simplify by remving the macro / external variable,
and having just a function. User changed. This avoids
the need for an external variable that might clash.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Mon, 11 Mar 2019 16:40:29 -0700 |
parents | b06060465f09 |
children |
rev | line source |
---|---|
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
1 /* check-version.h --- Check version string compatibility. |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
2 Copyright (C) 1998-2006, 2008-2019 Free Software Foundation, Inc. |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
3 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
4 This program is free software; you can redistribute it and/or modify |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
5 it under the terms of the GNU General Public License as published by |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
6 the Free Software Foundation; either version 2, or (at your option) |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
7 any later version. |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
8 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
9 This program is distributed in the hope that it will be useful, |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
10 but WITHOUT ANY WARRANTY; without even the implied warranty of |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
12 GNU General Public License for more details. |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
13 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
14 You should have received a copy of the GNU General Public License |
19190 | 15 along with this program; if not, see <https://www.gnu.org/licenses/>. */ |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
16 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
17 /* Written by Simon Josefsson. This interface is influenced by |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
18 gcry_check_version from Werner Koch's Libgcrypt. Paul Eggert |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
19 suggested the use of strverscmp to simplify implementation. */ |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
20 |
7584
a88f85e4728f
* lib/arcfour.c: Assume config.h.
Eric Blake <ebb9@byu.net>
parents:
6942
diff
changeset
|
21 #include <config.h> |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
22 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
23 #include <stddef.h> |
10345
8d80c477e0ad
strverscmp: migrate from "strverscmp.h" to <string.h>
Eric Blake <ebb9@byu.net>
parents:
7584
diff
changeset
|
24 #include <string.h> |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
25 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
26 /* Get specification. */ |
5942 | 27 #include "check-version.h" |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
28 |
6942
9e87d8474fb1
* lib/argp-pv.c: Remove a doubled word in a comment.
Jim Meyering <jim@meyering.net>
parents:
6259
diff
changeset
|
29 /* Check that the version of the library (i.e., the CPP symbol VERSION) |
9e87d8474fb1
* lib/argp-pv.c: Remove a doubled word in a comment.
Jim Meyering <jim@meyering.net>
parents:
6259
diff
changeset
|
30 * is at minimum the requested one in REQ_VERSION (typically found in |
9e87d8474fb1
* lib/argp-pv.c: Remove a doubled word in a comment.
Jim Meyering <jim@meyering.net>
parents:
6259
diff
changeset
|
31 * a header file) and return the version string. Return NULL if the |
9e87d8474fb1
* lib/argp-pv.c: Remove a doubled word in a comment.
Jim Meyering <jim@meyering.net>
parents:
6259
diff
changeset
|
32 * condition is not satisfied. If a NULL is passed to this function, |
9e87d8474fb1
* lib/argp-pv.c: Remove a doubled word in a comment.
Jim Meyering <jim@meyering.net>
parents:
6259
diff
changeset
|
33 * no check is done, but the version string is simply returned. |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
34 */ |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
35 const char * |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
36 check_version (const char *req_version) |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
37 { |
5996
1805e2c15a5b
(check_version): Accept identical versions too.
Simon Josefsson <simon@josefsson.org>
parents:
5942
diff
changeset
|
38 if (!req_version || strverscmp (req_version, VERSION) <= 0) |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
39 return VERSION; |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
40 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
41 return NULL; |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
42 } |