#include <stdio.h>
#include <errno.h>
-#ifndef HAVE_STRERROR
-# ifndef HAVE_ERRNO_DECL
-extern int errno;
-extern int sys_nerr;
-# if (linux)
-extern const char *const sys_errlist[];
-# else
-extern char *sys_errlist[];
-# endif
-# endif
-#endif
-
#include <sys/param.h>
#include <X11/cursorfont.h>
#include <X11/Intrinsic.h>
SFchdir (SFstartDir);
if ((fp = fopen (name, mode)) == NULL) {
char *buf;
-#ifdef HAVE_STRERROR
char *errormsg = strerror (errno);
if (errormsg) {
buf = XtMalloc (
strcpy (buf, failed);
strcat (buf, errormsg);
strcat (buf, "\n");
-#else
- if (errno < sys_nerr) {
- buf = XtMalloc (
- strlen (failed) + strlen (sys_errlist[errno]) +
- strlen (prompt) + 2
- );
- strcpy (buf, failed);
- strcat (buf, sys_errlist[errno]);
- strcat (buf, "\n");
- strcat (buf, prompt);
-#endif
} else {
buf = XtMalloc (strlen (failed) + strlen (prompt) + 2);
strcpy (buf, failed);
lib sincos
lib strcasecmp
lib strncasecmp
-lib strerror
hdr dirent
hdr dlfcn
sys ndir
cat{ }end
-dat errno stdio.h errno.h yes{
-/* Define if errno is declared in system include files. */
-#define HAVE_ERRNO_DECL 1
-}end
-
# Specify internal structure of FILE.
# This is used to determine if more characters are waiting in the stream.
if mem - FILE._cnt stdio.h {
# Checks for library functions
AC_CHECK_FUNCS([lrand48 drand48 srand48 setmode setenv getenv \
- strerror cbrt vsnprintf _NSGetEnviron])
+ cbrt vsnprintf _NSGetEnviron])
AC_REPLACE_FUNCS([strcasecmp strncasecmp strcasestr])
# -----------------------------------
-AC_MSG_CHECKING(if errno externs are declared)
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
- #include <errno.h>
- ]], [[if ( errno < sys_nerr ) return sys_errlist[errno];
- ]])],[AC_MSG_RESULT(yes)
- AC_DEFINE_UNQUOTED(HAVE_ERRNO_DECL,1,Define if errno externs are declared)
- ],[AC_MSG_RESULT(no)
- ])
-
-# -----------------------------------
-
AC_MSG_CHECKING(if intptr_t is declared)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
#include <stdint.h>
libast_C_la_SOURCES = pathpath.c sfstr.h chresc.c chrtoi.c error.c \
fmtbuf.c fmtesc.c pathaccess.c pathbin.c pathcanon.c pathcat.c \
pathexists.c pathfind.c pathgetlink.c \
- strcopy.c stresc.c strmatch.c strton.c strerror.c
+ strcopy.c stresc.c strmatch.c strton.c
EXTRA_DIST = compat_unistd.h ast.vcxproj*
<ClCompile Include="pathgetlink.c" />
<ClCompile Include="pathpath.c" />
<ClCompile Include="strcopy.c" />
- <ClCompile Include="strerror.c" />
<ClCompile Include="stresc.c" />
<ClCompile Include="strmatch.c" />
<ClCompile Include="strton.c" />
<ClCompile Include="strcopy.c">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="strerror.c">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="stresc.c">
<Filter>Source Files</Filter>
</ClCompile>
+++ /dev/null
-/* $Id$ $Revision$ */
-/* vim:set shiftwidth=4 ts=8: */
-
-/*************************************************************************
- * Copyright (c) 2011 AT&T Intellectual Property
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: See CVS logs. Details at http://www.graphviz.org/
- *************************************************************************/
-
-
-#include "config.h"
-#ifndef HAVE_STRERROR
-#include <errno.h>
-
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-char *strerror(int errorNumber)
-{
- if (errorNumber > 0 && errorNumber < sys_nerr) {
- return sys_errlist[errorNumber];
- } else {
- return "";
- }
-}
-#endif
/* Define to 1 if you have the `drand48' function. */
/* #undef HAVE_DRAND48 */
-/* Define if errno externs are declared */
-/* #undef HAVE_ERRNO_DECL */
-
/* Define if you have the expat library */
#define HAVE_EXPAT 1
/* Define to 1 if you have the `strcasecmp' function. */
//#define HAVE_STRCASECMP 1
-/* Define to 1 if you have the `strerror' function. */
-#define HAVE_STRERROR 1
-
/* Define to 1 if you have the <strings.h> header file. */
//#define HAVE_STRINGS_H 1