Dear MSYS2 developers,
It is first time to write an message here.
I tried building GNUstep in MSYS2, but confronted some compile errors.
Firstly, typedef BOOL makes error as below:
--------------------------------------------------------------
In file included from ../../Headers/GNUstepBase/GSTypeEncoding.h:36:0,
from GSTypeEncoding.c:29:
F:/msys64/mingw32/lib/gcc/i686-w64-mingw32/5.2.0/include/objc/objc.h:55:24:
error: conflicting types for 'BOOL'
typedef unsigned char BOOL;
^
In file included from
F:/msys64/mingw32/i686-w64-mingw32/include/windef.h:8:0,
from
F:/msys64/mingw32/i686-w64-mingw32/include/windows.h:69,
from .././GNUstepBase/GSConfig.h:291,
from ../../Headers/GNUstepBase/GSVersionMacros.h:219,
from ../../Headers/GNUstepBase/GSTypeEncoding.h:30,
from GSTypeEncoding.c:29:
F:/msys64/mingw32/i686-w64-mingw32/include/minwindef.h:131:15: note:
previous declaration of 'BOOL' was here
typedef int BOOL;
^
---------------------------------------------------------------
gcc objc uses "unsigned char" for type BOOL, but msys2 use "int".
msys2 defined macro like this:
Index: /msys64/mingw32/i686-w64-mingw32/include/minwindef.h:125,1
==========================================================
#ifndef _DEF_WINBOOL_
#define _DEF_WINBOOL_
typedef int WINBOOL;
#pragma push_macro("BOOL")
#undef BOOL
#if !defined(__OBJC__) && !defined(__OBJC_BOOL) &&
!defined(__objc_INCLUDE_GNU) && !defined(_NO_BOOL_TYPEDEF)
typedef int BOOL
#endif
==========================================================
However, this did not work because <minwindef.h> is loaded before <objc.h>.
I have suppressed "typedef int BOOL" by "#define __OBJC_BOOL".
Using "__OBJC__" made building errors in other part.
Is there better suggestion? Which header should be modified for msys2 or
gcc objc?
Secondly, keyword "interface" makes error when building gnustep-gui as
below:
------------------------------------------------------------------------------------------------------
Making all in Source ...
Making all for library libgnustep-gui...
Compiling file NSBitmapImageRep+JPEG.m ...
In file included from
F:/msys64/mingw32/i686-w64-mingw32/include/objbase.h:14:0,
from F:/msys64/mingw32/i686-w64-mingw32/include/ole2.h:17,
from
F:/msys64/mingw32/i686-w64-mingw32/include/wtypes.h:12,
from
F:/msys64/mingw32/i686-w64-mingw32/include/winscard.h:10,
from
F:/msys64/mingw32/i686-w64-mingw32/include/windows.h:97,
from
F:/msys64/mingw32/i686-w64-mingw32/include/winsock2.h:23,
from
F:/msys64/mingw32/GNUstep/System/Library/Headers/GNUstepBase/GSConfig.h:291,
from
F:/msys64/mingw32/GNUstep/System/Library/Headers/GNUstepBase/GSVersionMacros.h:219,
from
F:/msys64/mingw32/GNUstep/System/Library/Headers/Foundation/NSData.h:27,
from NSBitmapImageRep+JPEG.m:30:
F:/msys64/mingw32/i686-w64-mingw32/include/shlwapi.h:783:3: error: unknown
type name 'interface'
DECLARE_INTERFACE_(IQueryAssociations,IUnknown) {
^
F:/msys64/mingw32/i686-w64-mingw32/include/shlwapi.h:783:3: error: expected
'=', ',', ';', 'asm' or '__attribute__' before '{' token
DECLARE_INTERFACE_(IQueryAssociations,IUnknown) {
^
---------------------------------------------------------------------------------------------------------
"windows.h" contain some code for conflict of keyword "interface":
Index: /msys64/mingw32/i686-w64-mingw32/include/windows.h:12,1
=========================================================
/* Some kludge for Obj-C.
For Obj-C the 'interface' is a keyword, but interface is used
in midl-code too. To resolve this conflict for at least the
main windows API header, we define it here temporary. */
#ifdef __OBJC__
#pragma push_macro("interface")
#undef interface
#define interface struct
#endif
Index: /msys64/mingw32/i686-w64-mingw32/include/windows.h:136,1
=========================================================
/* Restore old value of interface for Obj-C. See above. */
#ifdef __OBJC__
#pragma pop_macro("interface")
#endif
However, this is not applied to "shlwapi.h" for gnustep-gui, "shlobj.h" for
gnustep WinUXTheme.
Just copy & paste of "interface" kludge from "windows.h" to "shlwapi.h" and
"shlobj.h" was well-worked. Would these changes be able to be applied to
the msys2 header?
Best Regards,
Lee, Seong-Gu
------------------------------------------------------------------------------
_______________________________________________
Msys2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/msys2-users