diff options
Diffstat (limited to 'librabbitmq/utils/strdup.h')
-rw-r--r-- | librabbitmq/utils/strdup.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/librabbitmq/utils/strdup.h b/librabbitmq/utils/strdup.h new file mode 100644 index 0000000..1571763 --- /dev/null +++ b/librabbitmq/utils/strdup.h @@ -0,0 +1,10 @@ +#ifndef LIBRABBITMQ_STRDUP_H_ +#define LIBRABBITMQ_STRDUP_H_ +/* strdup is not in ISO C90! + * we define it here for easy inclusion + */ +static inline char *strdup(const char *str) +{ + return strcpy(malloc(strlen(str) + 1),str); +} +#endif |