Build fix: poll compatibility mode: zmalloc prototype changed
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 8 Apr 2022 18:22:11 +0000 (14:22 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 8 Apr 2022 18:22:11 +0000 (14:22 -0400)
commitc56f67e5d0844c92823c7c9aa1a1222cf6daf22a
tree9e62d0df6b6d41e6a4ce17e04bc5b44e893ff5b7
parent6f729565b0b93009bc1e91a05bae6b7e04c1e8a1
Build fix: poll compatibility mode: zmalloc prototype changed

The build fails on platforms that don't support the epoll system
call (or when building with --disable-epoll on Linux):

  compat/poll.cpp:458:35: error: no matching function for call to 'zmalloc'
          wait->events = (struct pollfd *) zmalloc(size * sizeof(struct pollfd));
                                           ^~~~~~~
  ./macros.hpp:85:4: note: candidate template ignored: couldn't infer template argument 'T'
  T *zmalloc(size_t size)
     ^
  ./macros.hpp:74:4: note: candidate function template not viable: requires 0 arguments, but 1 was provided
  T *zmalloc()
     ^
  compat/poll.cpp:466:38: error: no matching function for call to 'zmalloc'
          current->events = (struct pollfd *) zmalloc(size * sizeof(struct pollfd));
                                              ^~~~~~~
  ./macros.hpp:85:4: note: candidate template ignored: couldn't infer template argument 'T'
  T *zmalloc(size_t size)
     ^
  ./macros.hpp:74:4: note: candidate function template not viable: requires 0 arguments, but 1 was provided
  T *zmalloc()

Replace the uses of "old style" malloc with the new type-safe
function introduced recently.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ib1660f6a548c155f021843b7476d5d64c06c6e5a
src/common/compat/poll.cpp
This page took 0.025285 seconds and 4 git commands to generate.