File jdk7-gcc15.patch of Package java-1_7_0-openjdk
--- openjdk/hotspot/agent/src/os/linux/libproc.h
+++ openjdk/hotspot/agent/src/os/linux/libproc.h
@@ -74,10 +74,13 @@ combination of ptrace and /proc calls.
// This C bool type must be int for compatibility with Linux calls and
// it would be a mistake to equivalence it to C++ bool on many platforms
-
+#ifndef __cplusplus
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
typedef int bool;
#define true 1
#define false 0
+#endif
+#endif
struct ps_prochandle;
--- openjdk/hotspot/make/linux/makefiles/gcc.make
+++ openjdk/hotspot/make/linux/makefiles/gcc.make
@@ -80,7 +80,7 @@ ifeq ($(TYPE),SHARK)
CFLAGS += $(LIBFFI_CFLAGS)
CFLAGS += $(LLVM_CFLAGS)
endif
-CFLAGS += -std=gnu++98
+CFLAGS += -std=gnu++98 -std=gnu99
CFLAGS += $(VM_PICFLAG)
CFLAGS += -fno-rtti
CFLAGS += -fno-exceptions
--- openjdk/jdk/make/common/Defs-linux.gmk
+++ openjdk/jdk/make/common/Defs-linux.gmk
@@ -223,6 +223,7 @@ endif
ifeq ($(shell $(EXPR) $(CC_MAJORVER) \>= 6 ),1)
CFLAGS_REQUIRED += -fno-delete-null-pointer-checks -fno-lifetime-dse
endif
+CFLAGS_REQUIRED += -std=gnu99
# If this is a --hash-style=gnu system, use --hash-style=both
# The gnu .hash section won't work on some Linux systems like SuSE 10.
--- openjdk/jdk/make/sun/awt/Makefile
+++ openjdk/jdk/make/sun/awt/Makefile
@@ -123,7 +123,7 @@ endif
ifeq ($(PLATFORM), linux)
FILES_c = $(FILES_2D_c)
FILES_c += awt_LoadLibrary.c
-OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH
+OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH -std=gnu99
OTHER_LDLIBS = $(JVMLIB) $(LIBM) $(LIBDL)
endif
--- openjdk/jdk/make/sun/image/generic/Makefile
+++ openjdk/jdk/make/sun/image/generic/Makefile
@@ -67,7 +67,7 @@ endif
CPPFLAGS += \
-I$(PLATFORM_SRC)/native/$(PKGDIR)/medialib
-OTHER_CFLAGS += -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES
+OTHER_CFLAGS += -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES -std=gnu99
ifneq ($(PLATFORM), windows)
OTHER_LDLIBS = $(LIBM) $(LIBDL)
--- openjdk/jdk/make/sun/image/vis/Makefile
+++ openjdk/jdk/make/sun/image/vis/Makefile
@@ -67,6 +67,6 @@ INLINE = $(PLATFORM_SRC)/native/sun/awt/medialib/vis_$(ARCH_DATA_MODEL).il
CFLAGS += $(CFLAGS_$(ARCH)) $(INLINE) -I$(PLATFORM_SRC)/native/sun/awt/medialib -I$(SHARE_SRC)/native/sun/awt/medialib
-OTHER_CFLAGS += -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES
+OTHER_CFLAGS += -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES -std=gnu99
OTHER_LDLIBS = $(LIBM) $(LIBDL)
--- openjdk/jdk/src/share/bin/java.c
+++ openjdk/jdk/src/share/bin/java.c
@@ -143,7 +143,7 @@ static struct vmdesc *knownVMs = NULL;
static int knownVMsCount = 0;
static int knownVMsLimit = 0;
-static void GrowKnownVMs();
+static void GrowKnownVMs(int);
static int KnownVMIndex(const char* name);
static void FreeKnownVMs();
static jboolean IsWildCardEnabled();
--- openjdk/jdk/src/share/native/common/jni_util.h
+++ openjdk/jdk/src/share/native/common/jni_util.h
@@ -407,7 +407,7 @@ char* nativeGetStringPlatformChars(JNIEnv *env, jstring jstr, jboolean *isCopy);
int getFastEncoding();
-void initializeEncoding();
+void initializeEncoding(JNIEnv *env);
#ifdef __cplusplus
--- openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.c 2025-08-27 15:05:28.803792896 +0200
+++ openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.c 2025-08-27 15:28:22.577996433 +0200
@@ -240,7 +240,7 @@
g_object_unref (gtk2_black_pixmap);
g_object_unref (gtk2_white_pixbuf);
g_object_unref (gtk2_black_pixbuf);
- gtk2_white_pixmap = gtk2_black_pixmap =
+ gtk2_white_pixmap = gtk2_black_pixmap = NULL;
gtk2_white_pixbuf = gtk2_black_pixbuf = NULL;
}
gtk2_pixbuf_width = 0;
@@ -518,7 +518,7 @@
}
arrow = gtk2_widgets[_GTK_ARROW_TYPE];
- gtk_arrow_set (arrow, arrow_type, shadow_type);
+ gtk_arrow_set ((GtkArrow *)arrow, arrow_type, shadow_type);
return arrow;
}
@@ -869,7 +869,7 @@
(NULL == gtk2_widgets[_GTK_SEPARATOR_TOOL_ITEM_TYPE]))
{
gtk2_widgets[_GTK_SEPARATOR_TOOL_ITEM_TYPE] =
- gtk_separator_tool_item_new();
+ (GtkWidget *) gtk_separator_tool_item_new();
}
result = gtk2_widgets[_GTK_SEPARATOR_TOOL_ITEM_TYPE];
break;
@@ -1527,7 +1527,7 @@
value.g_type = 0;
GParamSpec* param = gtk_widget_class_find_style_property (
- ((GTypeInstance*)gtk2_widget)->g_class, key);
+ ((GtkWidgetClass *)((GTypeInstance*)gtk2_widget)->g_class), key);
if( param )
{
g_value_init ( &value, param->value_type );
@@ -1792,14 +1792,14 @@
jobject get_integer_property(JNIEnv *env, GtkSettings* settings, const gchar* key)
{
- gint intval = NULL;
+ gint intval = 0;
g_object_get (settings, key, &intval, NULL);
return create_Integer(env, intval);
}
jobject get_boolean_property(JNIEnv* env, GtkSettings* settings, const gchar *key)
{
- gint intval = NULL;
+ gint intval = 0;
g_object_get (settings, key, &intval, NULL);
return create_Boolean(env, intval);