jdk/src/solaris/native/sun/awt/gtk2_interface.c
changeset 18232 b538b71fb429
parent 16471 33bca48c948b
child 19177 73eb8134c0d2
equal deleted inserted replaced
18231:2948d734293d 18232:b538b71fb429
    29 #include <stdio.h>
    29 #include <stdio.h>
    30 #include <string.h>
    30 #include <string.h>
    31 #include "gtk2_interface.h"
    31 #include "gtk2_interface.h"
    32 #include "java_awt_Transparency.h"
    32 #include "java_awt_Transparency.h"
    33 #include "jvm_md.h"
    33 #include "jvm_md.h"
       
    34 #include "sizecalc.h"
    34 
    35 
    35 #define GTK2_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gtk-x11-2.0", "0")
    36 #define GTK2_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gtk-x11-2.0", "0")
    36 #define GTK2_LIB JNI_LIB_NAME("gtk-x11-2.0")
    37 #define GTK2_LIB JNI_LIB_NAME("gtk-x11-2.0")
    37 #define GTHREAD_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gthread-2.0", "0")
    38 #define GTHREAD_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gthread-2.0", "0")
    38 #define GTHREAD_LIB JNI_LIB_NAME("gthread-2.0")
    39 #define GTHREAD_LIB JNI_LIB_NAME("gthread-2.0")
   763 
   764 
   764     if (gtk_modules_env && strstr (gtk_modules_env, "atk-bridge") ||
   765     if (gtk_modules_env && strstr (gtk_modules_env, "atk-bridge") ||
   765         gtk_modules_env && strstr (gtk_modules_env, "gail"))
   766         gtk_modules_env && strstr (gtk_modules_env, "gail"))
   766     {
   767     {
   767         /* the new env will be smaller than the old one */
   768         /* the new env will be smaller than the old one */
   768         gchar *s, *new_env = malloc (sizeof(ENV_PREFIX)+strlen (gtk_modules_env));
   769         gchar *s, *new_env = SAFE_SIZE_STRUCT_ALLOC(malloc,
       
   770                 sizeof(ENV_PREFIX), 1, strlen (gtk_modules_env));
   769 
   771 
   770         if (new_env != NULL )
   772         if (new_env != NULL )
   771         {
   773         {
   772             /* careful, strtok modifies its args */
   774             /* careful, strtok modifies its args */
   773             gchar *tmp_env = strdup (gtk_modules_env);
   775             gchar *tmp_env = strdup (gtk_modules_env);