[Pixman] declaration of fence_malloc in util.[ch]

Maarten Bosmans mkbosmans at gmail.com
Sun Jan 23 07:54:18 PST 2011


When cross-compiling pixman (0.21.4) with mingw, I get the following error:
  CC     utils.o
In file included from utils.c:3:0:
utils.h:14:0: warning: ignoring #pragma omp threadprivate
utils.c:298:1: error: conflicting types for 'fence_malloc'
utils.h:69:1: note: previous declaration of 'fence_malloc' was here

Complete build log:

In test/util.c fence_malloc is implemented roughly as:

#if defined(HAVE_MPROTECT) && defined(HAVE_GETPAGESIZE) &&
void * fence_malloc (int64_t len)
  /* implementation */
void * fence_malloc (int32_t len)
  return malloc (len);

While in test/util.h it is declared with an int64_t argument unconditionally.

What is the right resolution here? Either in the header file the
definition of fence_malloc should also depend on the HAVE_ macros, or
fence_malloc should always have an int64_t argument.


More information about the Pixman mailing list