--- glib-2.34.0.orig/gio/glib-compile-resources.c	2012-11-06 10:43:36.000000000 +0100
+++ glib-2.24.0/gio/glib-compile-resources.c	2012-11-06 10:55:21.788278318 +0100
@@ -605,9 +605,11 @@ main (int argc, char **argv)
   gboolean generate_source = FALSE;
   gboolean generate_header = FALSE;
   gboolean manual_register = FALSE;
+  gboolean internal = FALSE;
   gboolean generate_dependencies = FALSE;
   char *c_name = NULL;
   char *c_name_no_underscores;
+  const char *linkage = "extern";
   GOptionContext *context;
   GOptionEntry entries[] = {
     { "target", 0, 0, G_OPTION_ARG_FILENAME, &target, N_("name of the output file"), N_("FILE") },
@@ -617,6 +619,7 @@ main (int argc, char **argv)
     { "generate-source", 0, 0, G_OPTION_ARG_NONE, &generate_source, N_("Generate sourcecode used to link in the resource file into your code"), NULL },
     { "generate-dependencies", 0, 0, G_OPTION_ARG_NONE, &generate_dependencies, N_("Generate dependency list"), NULL },
     { "manual-register", 0, 0, G_OPTION_ARG_NONE, &manual_register, N_("Don't automatically create and register resource"), NULL },
+    { "internal", 0, 0, G_OPTION_ARG_NONE, &internal, N_("Don't export functions; declare them G_GNUC_INTERNAL"), NULL },
     { "c-name", 0, 0, G_OPTION_ARG_STRING, &c_name, N_("C identifier name used for the generated source code"), NULL },
     { NULL }
   };
@@ -664,6 +667,9 @@ main (int argc, char **argv)
       return 1;
     }
 
+  if (internal)
+    linkage = "G_GNUC_INTERNAL";
+
   srcfile = argv[1];
 
   xmllint = g_strdup (g_getenv ("XMLLINT"));
@@ -805,16 +811,16 @@ main (int argc, char **argv)
 	       "\n"
 	       "#include <gio/gio.h>\n"
 	       "\n"
-	       "extern GResource *%s_get_resource (void);\n",
-	       c_name, c_name, c_name);
+	       "%s GResource *%s_get_resource (void);\n",
+	       c_name, c_name, linkage, c_name);
 
       if (manual_register)
 	fprintf (file,
 		 "\n"
-		 "extern void %s_register_resource (void);\n"
-		 "extern void %s_unregister_resource (void);\n"
+		 "%s void %s_register_resource (void);\n"
+		 "%s void %s_unregister_resource (void);\n"
 		 "\n",
-		 c_name, c_name);
+		 linkage, c_name, linkage, c_name);
 
       fprintf (file,
 	       "#endif\n");
@@ -870,30 +876,30 @@ main (int argc, char **argv)
       fprintf (file,
 	       "\n"
 	       "static GStaticResource static_resource = { %s_resource_data.data, sizeof (%s_resource_data.data) };\n"
-	       "extern GResource *%s_get_resource (void);\n"
+	       "%s GResource *%s_get_resource (void);\n"
 	       "GResource *%s_get_resource (void)\n"
 	       "{\n"
 	       "  return g_static_resource_get_resource (&static_resource);\n"
 	       "}\n",
-	       c_name, c_name, c_name, c_name);
+	       c_name, c_name, linkage, c_name, c_name);
 
 
       if (manual_register)
 	{
 	  fprintf (file,
 		   "\n"
-		   "extern void %s_unregister_resource (void);\n"
+		   "%s void %s_unregister_resource (void);\n"
 		   "void %s_unregister_resource (void)\n"
 		   "{\n"
 		   "  g_static_resource_fini (&static_resource);\n"
 		   "}\n"
 		   "\n"
-		   "extern void %s_register_resource (void);\n"
+		   "%s void %s_register_resource (void);\n"
 		   "void %s_register_resource (void)\n"
 		   "{\n"
 		   "  g_static_resource_init (&static_resource);\n"
 		   "}\n",
-		   c_name, c_name, c_name, c_name);
+		   linkage, c_name, c_name, linkage, c_name, c_name);
 	}
       else
 	{
