From c38f5a1818854b88e1215a1fcb09178e285a4d3d Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 4 Nov 2003 20:25:45 +0000 Subject: [PATCH] Get rid of the intmax_t dependancies and just specify the maximum reasonable integer size manually, using a non-conflicting typedef. --- usr.bin/getconf/getconf.c | 6 +++--- usr.bin/getconf/getconf.h | 11 ++++++----- usr.bin/getconf/limits.gperf | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/usr.bin/getconf/getconf.c b/usr.bin/getconf/getconf.c index b2baee0972..4c3db534cc 100644 --- a/usr.bin/getconf/getconf.c +++ b/usr.bin/getconf/getconf.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/getconf/getconf.c,v 1.6.2.1 2002/10/27 04:18:40 wollman Exp $ - * $DragonFly: src/usr.bin/getconf/getconf.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/getconf/getconf.c,v 1.3 2003/11/04 20:25:45 dillon Exp $ */ #include @@ -59,7 +59,7 @@ main(int argc, char **argv) { int c, key, valid; const char *name, *vflag, *alt_path; - intmax_t limitval; + gc_intmax_t limitval; vflag = NULL; while ((c = getopt(argc, argv, "v:")) != -1) { @@ -98,7 +98,7 @@ main(int argc, char **argv) if (argv[optind + 1] == NULL) { /* confstr or sysconf */ if ((valid = find_limit(name, &limitval)) != 0) { if (valid > 0) - printf("%" PRIdMAX "\n", limitval); + printf("%" GC_PRIdMAX "\n", limitval); else printf("undefined\n"); diff --git a/usr.bin/getconf/getconf.h b/usr.bin/getconf/getconf.h index 94522199ec..ee8159411c 100644 --- a/usr.bin/getconf/getconf.h +++ b/usr.bin/getconf/getconf.h @@ -27,16 +27,17 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/getconf/getconf.h,v 1.4.2.1 2002/10/27 04:18:40 wollman Exp $ - * $DragonFly: src/usr.bin/getconf/getconf.h,v 1.3 2003/11/03 17:15:31 dillon Exp $ + * $DragonFly: src/usr.bin/getconf/getconf.h,v 1.4 2003/11/04 20:25:45 dillon Exp $ */ #include -#ifndef PRIdMAX -#define PRIdMAX "lld" /* XXX remove after intttypes.h abstraction from 5.x is ported */ -#endif + +#define GC_PRIdMAX "lld" + +typedef long long gc_intmax_t; int find_confstr(const char *name, int *key); -int find_limit(const char *name, intmax_t *value); +int find_limit(const char *name, gc_intmax_t *value); int find_pathconf(const char *name, int *key); int find_progenv(const char *name, const char **alt_path); int find_sysconf(const char *name, int *key); diff --git a/usr.bin/getconf/limits.gperf b/usr.bin/getconf/limits.gperf index 5a99fde212..2970d025c5 100644 --- a/usr.bin/getconf/limits.gperf +++ b/usr.bin/getconf/limits.gperf @@ -3,7 +3,7 @@ * Copyright is disclaimed as to the contents of this file. * * $FreeBSD: src/usr.bin/getconf/limits.gperf,v 1.1.2.1 2002/10/27 04:18:40 wollman Exp $ - * $DragonFly: src/usr.bin/getconf/limits.gperf,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/getconf/limits.gperf,v 1.3 2003/11/04 20:25:45 dillon Exp $ */ #include @@ -19,7 +19,7 @@ static const struct map *in_word_set(const char *str, unsigned int len); %} -struct map { const char *name; intmax_t value; int valid; }; +struct map { const char *name; gc_intmax_t value; int valid; }; %% _POSIX_CLOCKRES_MIN, _POSIX_CLOCKRES_MIN _POSIX_AIO_LISTIO_MAX, _POSIX_AIO_LISTIO_MAX @@ -103,7 +103,7 @@ NL_TEXTMAX, NL_TEXTMAX NZERO, NZERO %% int -find_limit(const char *name, intmax_t *value) +find_limit(const char *name, gc_intmax_t *value) { const struct map *rv; -- 2.41.0