This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PATCH for java.nio FileChannel and MappedByteBuffer
Per Bothner wrote:
andreas tobler wrote:
(Note that the version I checked in does have this code in
gnu/java/nio/natFileChannelPosix.cc, and uses teh symlink model.)
:) yep.
The first question is: does it matter? I believe for C it wouldn't,
but C++ has I believe more restrictive rules for (void*).
What shall we do, define POSIX_C_SOURCE being bigger than 2 in this file?
or do an ifdef for this case?
My inclination is the former.
I had something like this in mind. Though it'll take another 24 hours to
complete the build and test. The machine is a bit slow.
Andreas
Index: gnu/java/nio/channels/natFileChannelPosix.cc
===================================================================
RCS file:
/cvs/gcc/gcc/libjava/gnu/java/nio/channels/natFileChannelPosix.cc,v
retrieving revision 1.1
diff -u -r1.1 natFileChannelPosix.cc
--- gnu/java/nio/channels/natFileChannelPosix.cc 29 Feb 2004
19:09:28 -0000 1.1
+++ gnu/java/nio/channels/natFileChannelPosix.cc 8 Mar 2004
21:11:45 -0000
@@ -55,6 +55,13 @@
#endif
#ifdef HAVE_MMAP
+// To make the solaris 2.6 compilation work we have to bump the version
+// of _POSIX_C_SOURCE to a value bigger than 2.
+// Defined values can be found in sys/feature_tests.h.
+# if defined (__sparc__)
+# undef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 199506L
+# endif /* __sparc__ */
#include <sys/mman.h>
#endif