1 // Place the code and data below here into the LIBXBMS section.
3 #pragma code_seg( "LIBXBMS" )
4 #pragma data_seg( "LIBXBMS_RW" )
5 #pragma bss_seg( "LIBXBMS_RW" )
6 #pragma const_seg( "LIBXBMS_RD" )
7 #pragma comment(linker, "/merge:LIBXBMS_RW=LIBXBMS")
8 #pragma comment(linker, "/merge:LIBXBMS_RD=LIBXBMS")
12 * ----------------------------------------------------------------------
14 * ----------------------------------------------------------------------
16 * Copyright (c) 2002-2003 by PuhPuh
18 * This code is copyrighted property of the author. It can still
19 * be used for any non-commercial purpose following conditions:
21 * 1) This copyright notice is not removed.
22 * 2) Source code follows any distribution of the software
24 * 3) Copyright notice above is found in the documentation
25 * of the distributed software.
27 * Any express or implied warranties are disclaimed. Author is
28 * not liable for any direct or indirect damages caused by the use
31 * ----------------------------------------------------------------------
33 * This code has been integrated into XBMC Media Center.
34 * As such it can me copied, redistributed and modified under
35 * the same conditions as the XBMC itself.
40 #include "ccincludes.h"
43 void cc_fatal(const char *m)
46 fprintf(stderr, "FATAL ERROR%s%s\n",
47 (m != NULL) ? ": " : "",
48 (m != NULL) ? m : "");
53 void *cc_xmalloc(size_t n)
59 cc_fatal("Out of memory");
63 void *cc_xcalloc(size_t n, size_t s)
69 cc_fatal("Out of memory");
73 void *cc_xrealloc(void *o, size_t n)
79 cc_fatal("Out of memory");
83 void *cc_xstrdup(const char *s)
87 r = strdup(s != NULL ? s : "");
89 cc_fatal("Out of memory");
93 void *cc_xmemdup(const void *s, size_t len)
97 r = cc_xmalloc(len + 1);
104 void cc_xfree(void *p)