/[oroborus]/oroborus/src/xmalloc.c
ViewVC logotype

Diff of /oroborus/src/xmalloc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by dreamind, Mon Jul 15 08:23:08 2002 UTC revision 1.5 by dreamind, Wed Jul 17 22:20:40 2002 UTC
# Line 37  VOID *realloc (); Line 37  VOID *realloc ();
37  void free ();  void free ();
38  #endif  #endif
39    
40    # include <stdio.h>
41    
42  #if ENABLE_NLS  #if ENABLE_NLS
43  # include <libintl.h>  # include <libintl.h>
44  # define _(Text) gettext (Text)  # define _(Text) gettext (Text)
# Line 45  void free (); Line 47  void free ();
47  # define _(Text) Text  # define _(Text) Text
48  #endif  #endif
49    
 #include "error.h"  
   
50  #ifndef EXIT_FAILURE  #ifndef EXIT_FAILURE
51  # define EXIT_FAILURE 1  # define EXIT_FAILURE 1
52  #endif  #endif
# Line 65  char *xstrdup (char *p); Line 65  char *xstrdup (char *p);
65     The caller may set it to some other value.  */     The caller may set it to some other value.  */
66  int xmalloc_exit_failure = EXIT_FAILURE;  int xmalloc_exit_failure = EXIT_FAILURE;
67    
 #if __STDC__ && (HAVE_VPRINTF || HAVE_DOPRNT)  
 void error (int, int, const char *, ...);  
 #else  
 void error ();  
 #endif  
   
68  static VOID *  static VOID *
69  fixup_null_alloc (n)  fixup_null_alloc (n)
70                   size_t n;                   size_t n;
# Line 81  fixup_null_alloc (n) Line 75  fixup_null_alloc (n)
75          if (n == 0)          if (n == 0)
76                  p = malloc ((size_t) 1);                  p = malloc ((size_t) 1);
77          if (p == 0)          if (p == 0)
78                  error (xmalloc_exit_failure, 0, _("Memory exhausted"));                  {
79                            fprintf (stderr, "%s: %s\n", PACKAGE, _("Memory exhausted"));
80                            exit (xmalloc_exit_failure);
81                    }
82          return p;          return p;
83  }  }
84    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26