Search code examples
carchlinuxopenal

Some weird code in i686-w64-mingw32/include/shlobj.h


I was building openal for mingw-gcc

$ yaourt -S mingw-w64-openal

and got a syntax error:

[ 38%] Building C object CMakeFiles/OpenAL32.dir/Alc/alcConfig.c.obj
In file included from /tmp/yaourt-tmp-hacked/aur-mingw-w64-openal/src/openal-soft-1.16.0/Alc/alcConfig.c:36:0:
/usr/i686-w64-mingw32/include/shlobj.h:37:3: error: unknown type name ‘EXTERN_C’
   SHFOLDERAPI SHGetFolderPathW (HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, 
   ^
/usr/i686-w64-mingw32/include/shlobj.h:37:3: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘HRESULT’
   SHFOLDERAPI SHGetFolderPathW (HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, 
   ^
/usr/i686-w64-mingw32/include/shlobj.h:37:3: error: unknown type name ‘HRESULT’
CMakeFiles/OpenAL32.dir/build.make:463: recipe for target 'CMakeFiles/OpenAL32.dir/Alc/alcConfig.c.obj' failed
make[2]: *** [CMakeFiles/OpenAL32.dir/Alc/alcConfig.c.obj] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/OpenAL32.dir/all' failed
make[1]: *** [CMakeFiles/OpenAL32.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2

i've looked into this shlobj.h on line 37 and found this:

typedef enum {
  SHGFP_TYPE_CURRENT = 0,
  SHGFP_TYPE_DEFAULT = 1,
} SHGFP_TYPE;

  SHFOLDERAPI SHGetFolderPathW (HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath);

I'm not a pro in C, but seems like } is inside a enum block, so i've tried to fix it all the ways possible, but without success.


Solution

  • check this out - http://sourceforge.net/p/mingw-w64/bugs/476

    • Option #1 check the patch provided at that link - you have to rebuild
    • Option #2 Try to pull the version that has the patch included