#include "edje_cc.h"
+#ifdef _WIN32
+# define FMT_SIZE_T "%Iu"
+#else
+# define FMT_SIZE_T "%zu"
+#endif
+
void *
mem_alloc(size_t size)
{
mem = calloc(1, size);
if (mem) return mem;
- ERR("%s: Error. %s:%i memory allocation of %zi bytes failed. %s",
+ ERR("%s: Error. %s:%i memory allocation of " FMT_SIZE_T " bytes failed. %s",
progname, file_in, line, size, strerror(errno));
exit(-1);
return NULL;
str = strdup(s);
if (str) return str;
- ERR("%s: Error. %s:%i memory allocation of %zi bytes failed. %s. string being duplicated: \"%s\"",
+ ERR("%s: Error. %s:%i memory allocation of " FMT_SIZE_T " bytes failed. %s. string being duplicated: \"%s\"",
progname, file_in, line, strlen(s) + 1, strerror(errno), s);
exit(-1);
return NULL;
#define FLOAT_PRECISION 0.0001
#define FDIFF(a, b) (fabs((a) - (b)) > FLOAT_PRECISION)
+#ifdef _WIN32
+# define FMT_UCHAR "%c"
+#else
+# define FMT_UCHAR "%hhu"
+#endif
+
/* context */
static Eina_List *groups;
static Ecore_Evas *ee;
file = argv[arg_index];
- DBG("mode=%s, detail=%d(%s), group=%s, part=%s, program=%s, api-only=%hhu, "
- "api-fix=%hhu, machine=%hhu, file=%s",
+ DBG("mode=%s, detail=%d(%s), group=%s, part=%s, program=%s, api-only=" FMT_UCHAR
+ ", api-fix=" FMT_UCHAR ", machine=" FMT_UCHAR ", file=%s",
mode, detail, detail_name,
group ? group : "",
part ? part : "",
#include <Ecore_Evas.h>
#include <Edje.h>
+#ifdef _WIN32
+# define FMT_UCHAR "%c"
+#else
+# define FMT_UCHAR "%hhu"
+#endif
+
struct opts {
char *file;
char *group;
{
unsigned char *color = (unsigned char *)storage->ptrp;
- if (sscanf(str, "%hhu,%hhu,%hhu", color, color + 1, color + 2) != 3)
+ if (sscanf(str, FMT_UCHAR "," FMT_UCHAR "," FMT_UCHAR, color, color + 1, color + 2) != 3)
{
fprintf(stderr, "ERROR: incorrect color value '%s'\n", str);
return 0;
//--------------------------------------------------------------------------//
#define MAX_LUA_MEM (4 * (1024 * 1024))
+#ifdef _WIN32
+# define FMT_SIZE_T "%Iu"
+#else
+# define FMT_SIZE_T "%zu"
+#endif
+
//--------------------------------------------------------------------------//
typedef struct _Edje_Lua_Alloc Edje_Lua_Alloc;
ela->cur += nsize - osize;
if (ela->cur > ela->max)
{
- ERR("Edje Lua memory limit of %zu bytes reached (%zu allocated)",
+ ERR("Edje Lua memory limit of " FMT_SIZE_T " bytes reached (" FMT_SIZE_T " allocated)",
ela->max, ela->cur);
return NULL;
}
ptr2 = realloc(ptr, nsize);
if (ptr2) return ptr2;
- ERR("Edje Lua cannot re-allocate %zu bytes", nsize);
+ ERR("Edje Lua cannot re-allocate " FMT_SIZE_T " bytes", nsize);
return ptr2;
}