sim: added missed macro definition on MacOS
authorAndrea Mondelli <Andrea.Mondelli@ucf.edu>
Mon, 4 Feb 2019 20:12:40 +0000 (15:12 -0500)
committerAndrea Mondelli <Andrea.Mondelli@ucf.edu>
Wed, 6 Feb 2019 15:12:19 +0000 (15:12 +0000)
A recent patch add the use of the macro:
CMSG_ALIGN
This macro is not very cross-platform, and needs to be
defined according to the platform.

This patch defines the missing macro on MacOS.

Change-Id: I582f69e652dc060b4532358141179ad6d37eafc7
Reviewed-on: https://gem5-review.googlesource.com/c/16102
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>

src/sim/syscall_emul.hh

index ceeacd39bf69770721649ba151f86de2aba5da7c..5ba487c7cd347d9a6107e230f12cce55db7b4a02 100644 (file)
 #include "sim/syscall_emul_buf.hh"
 #include "sim/syscall_return.hh"
 
+#if defined(__APPLE__) && defined(__MACH__) && !defined(CMSG_ALIGN)
+#define CMSG_ALIGN(len) (((len) + sizeof(size_t) - 1) & ~(sizeof(size_t) - 1))
+#endif
+
 //////////////////////////////////////////////////////////////////////
 //
 // The following emulation functions are generic enough that they