From: Dave Love Date: Mon, 18 Nov 2002 15:35:07 +0000 (+0000) Subject: Include unistd.h, string.h, stdlib.h, X-Git-Tag: ttn-vms-21-2-B4~12368 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b400482b0000631d8f119434c0c38dae4204f64;p=emacs.git Include unistd.h, string.h, stdlib.h, fcntl.h, stdarg.h conditionally. (_GNU_SOURCE, __attribute__): Don't define. (optarg, optind, opterr): Declare. (lose, lose_syserr): Use NO_RETURN. (get_user_id): Use P_. --- diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index 21309a3634a..7393135daa9 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c @@ -29,30 +29,38 @@ Boston, MA 02111-1307, USA. */ Created 2002/03/22, by Colin Walters */ -#define _GNU_SOURCE - #include +#ifdef HAVE_UNISTD_H #include +#endif #include +#ifdef HAVE_STRING_H #include +#endif +#ifdef HAVE_STDLIB_H #include +#endif #include #include #include #include +#ifdef HAVE_FCNTL_H #include +#endif +#ifdef STDC_HEADERS #include +#endif #include +/* Needed for SunOS4, for instance. */ +extern char *optarg; +extern int optind, opterr; + #define MAX_ATTEMPTS 5 #define MAX_SCORES 200 #define MAX_DATA_LEN 1024 -#if !defined (__GNUC__) || __GNUC__ < 2 -#define __attribute__(x) -#endif - /* Declare the prototype for a general external function. */ #if defined (PROTOTYPES) || defined (WINDOWSNT) #define P_(proto) proto @@ -97,8 +105,7 @@ int write_scores P_((const char *filename, const struct score_entry *scores, int count)); -void lose P_((const char *msg)) - __attribute__ ((noreturn)); +void lose P_((const char *msg)) NO_RETURN; void lose(msg) const char *msg; @@ -107,8 +114,7 @@ void lose(msg) exit(1); } -void lose_syserr P_((const char *msg)) - __attribute__ ((noreturn)); +void lose_syserr P_((const char *msg)) NO_RETURN; void lose_syserr(msg) const char *msg; @@ -118,7 +124,7 @@ void lose_syserr(msg) } char * -get_user_id(void) +get_user_id P_ ((void)) { char *name; struct passwd *buf = getpwuid(getuid());