This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Patch: fix for PR libgcj/15
- To: Java Patch List <java-patches at sourceware dot cygnus dot com>
- Subject: Patch: fix for PR libgcj/15
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 21 Apr 2000 14:40:29 -0600
- Reply-To: tromey at cygnus dot com
I'm checking this in. It is a configury cleanup which fixes PR
libgcj/15.
2000-04-21 Tom Tromey <tromey@cygnus.com>
Fix for PR libgcj/15:
* java/util/natGregorianCalendar.cc (_REENTRANT,
_POSIX_PTHREAD_SEMANTICS): Don't define.
* java/net/natInetAddress.cc (_REENTRANT): Don't define.
* java/lang/natSystem.cc (_REENTRANT, _POSIX_PTHREAD_SEMANTICS):
Don't define.
* java/io/natFile.cc (_REENTRANT, _POSIX_PTHREAD_SEMANTICS): Don't
define.
* configure: Rebuilt.
* configure.in: If using POSIX threads, define _REENTRANT if
needed. Define _POSIX_PTHREAD_SEMANTICS. Don't define
GETHOSTBYNAME_R_NEEDS_REENTRANT.
Tom
Index: configure.in
===================================================================
RCS file: /cvs/java/libgcj/libjava/configure.in,v
retrieving revision 1.56
diff -u -r1.56 configure.in
--- configure.in 2000/04/06 00:29:39 1.56
+++ configure.in 2000/04/21 20:22:40
@@ -332,6 +332,13 @@
# But for now we don't check for it. We just assume you aren't
# using MIT pthreads.
AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_INIT)
+
+ # If we're using the Boehm GC, then we happen to know that it
+ # defines _REENTRANT, so we don't bother. Eww.
+ if test "$GC" != boehm; then
+ AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
+ fi
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Required define if using POSIX threads])
;;
none)
@@ -440,7 +447,7 @@
AC_LANG_RESTORE
])
if test "x$libjava_cv_gethostbyname_r_needs_reentrant" = xyes; then
- AC_DEFINE(GETHOSTBYNAME_R_NEEDS_REENTRANT, 1, [Define if gethostbyname_r is only declared if _REENTRANT is defined])
+ AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
fi
;;
esac
Index: java/io/natFile.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/io/natFile.cc,v
retrieving revision 1.6
diff -u -r1.6 natFile.cc
--- natFile.cc 2000/03/07 19:55:26 1.6
+++ natFile.cc 2000/04/21 20:22:41
@@ -1,6 +1,6 @@
// natFile.cc - Native part of File class.
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
@@ -21,10 +21,6 @@
#endif
#include <stdlib.h>
#ifdef HAVE_DIRENT_H
-#define _POSIX_PTHREAD_SEMANTICS
-#ifndef _REENTRANT
-# define _REENTRANT
-#endif
#include <dirent.h>
#endif
#include <string.h>
Index: java/lang/natSystem.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/natSystem.cc,v
retrieving revision 1.20
diff -u -r1.20 natSystem.cc
--- natSystem.cc 2000/03/07 19:55:26 1.20
+++ natSystem.cc 2000/04/21 20:22:42
@@ -10,13 +10,6 @@
#include <config.h>
-#ifdef HAVE_GETPWUID_R
-#define _POSIX_PTHREAD_SEMANTICS
-#ifndef _REENTRANT
-#define _REENTRANT
-#endif
-#endif
-
#include <string.h>
#include <time.h>
#include <stdlib.h>
Index: java/net/natInetAddress.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/net/natInetAddress.cc,v
retrieving revision 1.13
diff -u -r1.13 natInetAddress.cc
--- natInetAddress.cc 2000/03/15 22:03:19 1.13
+++ natInetAddress.cc 2000/04/21 20:22:42
@@ -1,6 +1,6 @@
// natInetAddress.cc
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
@@ -9,10 +9,6 @@
details. */
#include <config.h>
-
-#if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
-# define _REENTRANT 1
-#endif
#ifdef USE_WINSOCK
Index: java/util/natGregorianCalendar.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/natGregorianCalendar.cc,v
retrieving revision 1.5
diff -u -r1.5 natGregorianCalendar.cc
--- natGregorianCalendar.cc 2000/03/07 19:55:27 1.5
+++ natGregorianCalendar.cc 2000/04/21 20:22:44
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
@@ -7,16 +7,6 @@
details. */
#include <config.h>
-
-// We want to make sure to pick up the POSIX `_r' functions. Some
-// systems, such as Solaris 2.6, require this define in order to
-// declare the functions in the appropriate header.
-#if defined (HAVE_GMTIME_R) || defined (HAVE_LOCALTIME_R)
-# define _POSIX_PTHREAD_SEMANTICS
-# ifndef _REENTRANT
-# define _REENTRANT
-# endif /* _REENTRANT */
-#endif
#ifdef ECOS
#include <string.h>