1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdlib.h> #include <string.h> #include "mikmod.h" #undef strdup char* strdup(const char *__s) { char *charptr; if (!__s) return NULL; charptr=(char *)MikMod_malloc(sizeof(char) * (strlen(__s) + 1)); if (charptr) strcpy(charptr, __s); return charptr; }