mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-26 10:49:33 +00:00
[! HAVE_STRERROR] (strerror): Define the function.
This commit is contained in:
parent
e773d20a7b
commit
2771160004
@ -282,3 +282,18 @@ main (argc, argv)
|
||||
#endif /* HAVE_SYSVIPC */
|
||||
|
||||
#endif /* HAVE_SOCKETS or HAVE_SYSVIPC */
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
char *
|
||||
strerror (errnum)
|
||||
int errnum;
|
||||
{
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
|
||||
if (errnum >= 0 && errnum < sys_nerr)
|
||||
return sys_errlist[errnum];
|
||||
return (char *) "Unknown error";
|
||||
}
|
||||
|
||||
#endif /* ! HAVE_STRERROR */
|
||||
|
@ -333,3 +333,18 @@ myindex (str, c)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
char *
|
||||
strerror (errnum)
|
||||
int errnum;
|
||||
{
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
|
||||
if (errnum >= 0 && errnum < sys_nerr)
|
||||
return sys_errlist[errnum];
|
||||
return (char *) "Unknown error";
|
||||
}
|
||||
|
||||
#endif /* ! HAVE_STRERROR */
|
||||
|
@ -300,5 +300,20 @@ main (argc, argv)
|
||||
for (;;)
|
||||
pause ();
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
char *
|
||||
strerror (errnum)
|
||||
int errnum;
|
||||
{
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
|
||||
if (errnum >= 0 && errnum < sys_nerr)
|
||||
return sys_errlist[errnum];
|
||||
return (char *) "Unknown error";
|
||||
}
|
||||
|
||||
#endif /* ! HAVE_STRERROR */
|
||||
|
||||
/* timer.c ends here */
|
||||
|
Loading…
Reference in New Issue
Block a user