]> spindle.queued.net Git - midori/commitdiff
Use MDATA instead of DATA to avoid naming conflict
authorChristian Dywan <christian@twotoasts.de>
Sat, 6 Jun 2009 04:22:35 +0000 (06:22 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sat, 6 Jun 2009 04:22:35 +0000 (06:22 +0200)
The header file objidl.h on Windows uses DATA in a different way,
so we need to avoid that name.

midori/midori-browser.c
midori/midori-view.c
midori/sokoke.c
wscript

index 8bda421162a64f9062604fa85f47c0e73aab7ba0..65165d105a5b45a5c6ae8e49fc4a20bca7a765ea 100644 (file)
@@ -858,7 +858,7 @@ midori_browser_speed_dial_get_next_free_slot (void)
 
     if (!g_file_test (body_fname, G_FILE_TEST_EXISTS))
     {
-        if (g_file_get_contents (DATADIR "/midori/res/speeddial.json",
+        if (g_file_get_contents (MDATADIR "/midori/res/speeddial.json",
                                  &speed_dial_body, NULL, NULL))
         {
             g_file_set_contents (body_fname, speed_dial_body, -1, NULL);
index 0e137e5c95940dbdda3478f8e8e19a43bc4bc85c..84806ad816a37a3e7b8ffab8d4620dff8b8dab3c 100644 (file)
@@ -729,7 +729,7 @@ webkit_web_view_load_error_cb (WebKitWebView*  web_view,
                                GError*         error,
                                MidoriView*     view)
 {
-    const gchar* template_file = DATADIR "/midori/res/error.html";
+    const gchar* template_file = MDATADIR "/midori/res/error.html";
     gchar* template;
 
     if (g_file_get_contents (template_file, &template, NULL, NULL))
@@ -786,7 +786,7 @@ webkit_web_frame_load_done_cb (WebKitWebFrame* web_frame,
         data = g_strdup_printf (
             "<html><head><title>%s</title></head>"
             "<body><h1>%s</h1>"
-            "<img src=\"file://" DATADIR "/midori/logo-shade.png\" "
+            "<img src=\"file://" MDATADIR "/midori/logo-shade.png\" "
             "style=\"position: absolute; right: 15px; bottom: 15px;\">"
             "<p />The page you were opening doesn't exist."
             "<p />Try to <a href=\"%s\">load the page again</a>, "
@@ -2059,7 +2059,7 @@ midori_view_set_uri (MidoriView*  view,
 
             katze_assign (view->uri, g_strdup (""));
 
-            g_file_get_contents (DATADIR "/midori/res/speeddial-head.html",
+            g_file_get_contents (MDATADIR "/midori/res/speeddial-head.html",
                                  &speed_dial_head, NULL, NULL);
 
             res_server = sokoke_get_res_server ();
@@ -2071,7 +2071,7 @@ midori_view_set_uri (MidoriView*  view,
 
             if (!g_file_test (body_fname, G_FILE_TEST_EXISTS))
             {
-                if (g_file_get_contents (DATADIR "/midori/res/speeddial.json",
+                if (g_file_get_contents (MDATADIR "/midori/res/speeddial.json",
                                          &speed_dial_body, NULL, NULL))
                     g_file_set_contents (body_fname, speed_dial_body, -1, NULL);
                 else
@@ -2122,7 +2122,7 @@ midori_view_set_uri (MidoriView*  view,
                 data = g_strdup_printf (
                     "<html><head><title>%s</title></head>"
                     "<body><h1>%s</h1>"
-                    "<img src=\"file://" DATADIR "/midori/logo-shade.png\" "
+                    "<img src=\"file://" MDATADIR "/midori/logo-shade.png\" "
                     "style=\"position: absolute; right: 15px; bottom: 15px;\">"
                     "<p />The document %s of type '%s' cannot be displayed."
                     "</body></html>",
@@ -2139,7 +2139,7 @@ midori_view_set_uri (MidoriView*  view,
                 data = g_strdup_printf (
                     "<html><head><title>%s</title></head>"
                     "<body><h1>%s</h1>"
-                    "<img src=\"file://" DATADIR "/midori/logo-shade.png\" "
+                    "<img src=\"file://" MDATADIR "/midori/logo-shade.png\" "
                     "style=\"position: absolute; right: 15px; bottom: 15px;\">"
                     "<p />There is no documentation installed at %s."
                     "You may want to ask your distribution or "
index 5bee98b40cedffd02f260b5716ce9c49852c88b8..fe8fc61d64288c65251a56dae6751a3a469a53cd 100644 (file)
@@ -958,7 +958,7 @@ res_server_handler_cb (SoupServer*        res_server,
 {
     if (g_str_has_prefix (path, "/res"))
     {
-        gchar* filename = g_strconcat (DATADIR "/midori", path, NULL);
+        gchar* filename = g_strconcat (MDATADIR "/midori", path, NULL);
         gchar* contents;
         gsize length;
 
diff --git a/wscript b/wscript
index 6dcc215292d1dce3e123d7c1799119ce6dfe9612..02cd720344b4c9e1b9c24a9c6023e011ffc341c0 100644 (file)
--- a/wscript
+++ b/wscript
@@ -51,12 +51,14 @@ def configure (conf):
                 Utils.pprint ('RED', desc + ' N/A')
                 sys.exit (1)
 
-    def dirname_default (dirname, default):
+    def dirname_default (dirname, default, defname=None):
         if getattr (Options.options, dirname) == '':
             dirvalue = default
         else:
             dirvalue = getattr (Options.options, dirname)
-        conf.define (dirname, dirvalue)
+        if not defname:
+            defname = dirname
+        conf.define (defname, dirvalue)
         return dirvalue
 
     conf.check_tool ('compiler_cc')
@@ -86,13 +88,16 @@ def configure (conf):
         nls = 'no '
     conf.define ('ENABLE_NLS', [0,1][nls == 'yes'])
 
-    dirname_default ('DATADIR', os.path.join (conf.env['PREFIX'], 'share'))
     dirname_default ('DOCDIR', os.path.join (conf.env['DATADIR'], 'doc'))
     dirname_default ('LIBDIR', os.path.join (conf.env['PREFIX'], 'lib'))
     if conf.env['PREFIX'] == '/usr':
         dirname_default ('SYSCONFDIR', '/etc')
     else:
         dirname_default ('SYSCONFDIR', os.path.join (conf.env['PREFIX'], 'etc'))
+    dirname_default ('DATADIR', os.path.join (conf.env['PREFIX'], 'share'),
+    # Use MDATADIR because DATADIR is a constant in objidl.h on Windows
+        'MDATADIR')
+    conf.undefine ('DATADIR')
 
     if option_enabled ('apidocs'):
         conf.find_program ('gtkdoc-scan', var='GTKDOC_SCAN')