summaryrefslogtreecommitdiff
path: root/cont.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-11-30 09:01:36 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-11-30 09:10:58 +0900
commit12fbdf4d4e52bafaeef6f923b8f357a39a37c02b (patch)
tree1eca222c11629f2959bebad903ebc4311eeee107 /cont.c
parentac8647bec12d5d3c0bc4b6a79d09a6a85d6628f1 (diff)
downloadruby-12fbdf4d4e52bafaeef6f923b8f357a39a37c02b.tar.gz
Fix conflicting declaration on Solaris
SunC ``` "cont.c", line 24: identifier redeclared: madvise current : function(pointer to char, unsigned int, int) returning int previous: function(pointer to void, unsigned int, int) returning int : "/usr/include/sys/mman.h", line 232 ``` GCC ``` cont.c:24:12: error: conflicting types for 'madvise' 24 | extern int madvise(caddr_t, size_t, int); | ^~~~~~~ In file included from cont.c:16: /usr/include/sys/mman.h:232:12: note: previous declaration of 'madvise' was here 232 | extern int madvise(void *, size_t, int); | ^~~~~~~ ```
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/cont.c b/cont.c
index 2af7971a9a..290be43012 100644
--- a/cont.c
+++ b/cont.c
@@ -18,8 +18,7 @@
// On Solaris, madvise() is NOT declared for SUS (XPG4v2) or later,
// but MADV_* macros are defined when __EXTENSIONS__ is defined.
-#if defined(__sun) && defined(HAVE_CADDR_T) && \
- (defined(MADV_FREE) || defined(MADV_DONTNEED))
+#ifdef NEED_MADVICE_PROTOTYPE_USING_CADDR_T
#include <sys/types.h>
extern int madvise(caddr_t, size_t, int);
#endif