diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/edje/src/bin/edje_cc_mem.c | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to '')
-rw-r--r-- | libraries/edje/src/bin/edje_cc_mem.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/libraries/edje/src/bin/edje_cc_mem.c b/libraries/edje/src/bin/edje_cc_mem.c new file mode 100644 index 0000000..7c1a5c9 --- /dev/null +++ b/libraries/edje/src/bin/edje_cc_mem.c | |||
@@ -0,0 +1,40 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include "config.h" | ||
3 | #endif | ||
4 | |||
5 | #include <string.h> | ||
6 | #include <errno.h> | ||
7 | |||
8 | #include "edje_cc.h" | ||
9 | |||
10 | #ifdef _WIN32 | ||
11 | # define FMT_SIZE_T "%Iu" | ||
12 | #else | ||
13 | # define FMT_SIZE_T "%zu" | ||
14 | #endif | ||
15 | |||
16 | void * | ||
17 | mem_alloc(size_t size) | ||
18 | { | ||
19 | void *mem; | ||
20 | |||
21 | mem = calloc(1, size); | ||
22 | if (mem) return mem; | ||
23 | ERR("%s: Error. %s:%i memory allocation of " FMT_SIZE_T " bytes failed. %s", | ||
24 | progname, file_in, line, size, strerror(errno)); | ||
25 | exit(-1); | ||
26 | return NULL; | ||
27 | } | ||
28 | |||
29 | char * | ||
30 | mem_strdup(const char *s) | ||
31 | { | ||
32 | void *str; | ||
33 | |||
34 | str = strdup(s); | ||
35 | if (str) return str; | ||
36 | ERR("%s: Error. %s:%i memory allocation of " FMT_SIZE_T " bytes failed. %s. string being duplicated: \"%s\"", | ||
37 | progname, file_in, line, strlen(s) + 1, strerror(errno), s); | ||
38 | exit(-1); | ||
39 | return NULL; | ||
40 | } | ||