bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: configmake: fails on mingw due to DATADIR


From: Bruno Haible
Subject: Re: configmake: fails on mingw due to DATADIR
Date: Sun, 26 Oct 2008 14:40:43 +0100
User-agent: KMail/1.5.4

Hi Simon,

> The javaversion module includes configmake.h, which typically contains
> something like:
> 
> #define DATADIR "/usr/local/share"
> 
> This does not work well under mingw, because Windows has a data type
> called DATADIR, see:
> 
> http://msdn.microsoft.com/en-us/library/ms680661(VS.85).aspx
> 
> It is defined in objidl.h as:
> 
> typedef enum tagDATADIR 
> { 
>     DATADIR_GET            = 1, 
>     DATADIR_SET            = 2 
> } DATADIR; 
> 
> Compiling javaversion.c, you'll get warnings like:
> 
> In file included from 
> /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/objbase.h:73,
>                  from 
> /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/ole2.h:9,
>                  from 
> /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/windows.h:114,
>                  from 
> /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/winsock2.h:22,
>                  from ./unistd.h:49,
>                  from ./getopt.h:37,
>                  from 
> /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/unistd.h:14,
>                  from ./unistd.h:27,
>                  from pipe.h:23,
>                  from javaversion.c:37:
> /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/objidl.h:95:
>  error: expected identifier or ‘(’ before string constant

Uh, that's even an error, not only a warning. Another possible fix would be to
add "#define NOGDI" to configmake.h, but that only defers the problem - until
someone wants to make the simultaneous use of configmake.h and the entire
Windows headers.

I applied this:


2008-10-26  Simon Josefsson  <address@hidden>
            Bruno Haible  <address@hidden>

        Fix a clash between the type DATADIR on Windows and the macro DATADIR.
        * modules/configmake (Include): Add a note that the include must come
        after all system headers.
        * lib/javaversion.c: Include configmake.h after all other includes.

--- modules/configmake.orig     2008-10-26 14:27:13.000000000 +0100
+++ modules/configmake  2008-10-26 14:27:09.000000000 +0100
@@ -61,7 +61,8 @@
 CLEANFILES += configmake.h configmake.h-t
 
 Include:
-"configmake.h"
+/* Include only after all system include files.  */
+#include "configmake.h"
 
 License:
 LGPLv2+
--- lib/javaversion.c.orig      2008-10-26 14:27:13.000000000 +0100
+++ lib/javaversion.c   2008-10-26 14:24:31.000000000 +0100
@@ -30,9 +30,6 @@
 # define relocate(pathname) (pathname)
 #endif
 
-/* Get PKGDATADIR.  */
-#include "configmake.h"
-
 #include "javaexec.h"
 #include "pipe.h"
 #include "wait-process.h"
@@ -41,6 +38,9 @@
 
 #define _(str) gettext (str)
 
+/* Get PKGDATADIR.  */
+#include "configmake.h"
+
 
 struct locals
 {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]