diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 59a7f8deca60b24cd5e14a314f792049a145db4e..cc055c909e1bdd0bb3ca9ba3c26f3927794d6aa0 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -27,6 +27,17 @@ #include "config-host.h" #include "qemu/compiler.h" + +/* The following block of code temporarily renames the daemon() function so the + * compiler does not see the warning associated with it in stdlib.h on OSX + */ +#ifdef __APPLE__ +#define daemon qemu_fake_daemon_function +#include +#undef daemon +extern int daemon(int, int); +#endif + #include #include #include diff --git a/util/oslib-posix.c b/util/oslib-posix.c index d844387b79043febd5e464b8c1ac03a28dd385ca..7615be4e7a9fdab889930f32a92c5d6509668417 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -26,15 +26,6 @@ * THE SOFTWARE. */ -/* The following block of code temporarily renames the daemon() function so the - compiler does not see the warning associated with it in stdlib.h on OSX */ -#ifdef __APPLE__ -#define daemon qemu_fake_daemon_function -#include -#undef daemon -extern int daemon(int, int); -#endif - #if defined(__linux__) && (defined(__x86_64__) || defined(__arm__)) /* Use 2 MiB alignment so transparent hugepages can be used by KVM. Valgrind does not support alignments larger than 1 MiB,