Annotation of uae/src/missing.c, revision 1.1.1.5

1.1       root        1:  /*
                      2:   * UAE - The Un*x Amiga Emulator
                      3:   *
                      4:   * Various stuff missing in some OSes.
                      5:   *
                      6:   * Copyright 1997 Bernd Schmidt
                      7:   */
                      8: 
                      9: #include "sysconfig.h"
                     10: #include "sysdeps.h"
                     11: 
                     12: #include "uae.h"
                     13: 
                     14: #ifndef HAVE_STRDUP
                     15: 
                     16: char *my_strdup (const char *s)
                     17: {
                     18:     /* The casts to char * are there to shut up the compiler on HPUX */
                     19:     char *x = (char*)xmalloc(strlen((char *)s) + 1);
                     20:     strcpy(x, (char *)s);
                     21:     return x;
                     22: }
                     23: 
                     24: #endif
                     25: 
1.1.1.3   root       26: void *xmalloc (size_t n)
1.1       root       27: {
                     28:     void *a = malloc (n);
                     29:     if (a == NULL) {
1.1.1.5 ! root       30:        write_log ("virtual memory exhausted\n");
1.1.1.2   root       31:        abort ();
1.1       root       32:     }
                     33:     return a;
                     34: }
1.1.1.3   root       35: 
                     36: void *xcalloc (size_t n, size_t size)
                     37: {
                     38:     void *a = calloc (n, size);
                     39:     if (a == NULL) {
1.1.1.5 ! root       40:        write_log ("virtual memory exhausted\n");
1.1.1.3   root       41:        abort ();
                     42:     }
                     43:     return a;
                     44: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.