Undef DATADIR before including <shlobj.h> to avoid collision with DATADIR

2007-05-14  Tor Lillqvist  <tml@novell.com>

	* libgimpbase/gimpenv.c: Undef DATADIR before including <shlobj.h>
	to avoid collision with DATADIR enum in objidl.h. Define
	CSIDL_MYDOCUMENTS, CSIDL_MYMUSIC and CSIDL_MYVIDEO in case missing
	from shlobj.h.

	* libgimpbase/Makefile.am: Link with -lole32 on Win32 for
	CoTaskMemFree().


svn path=/trunk/; revision=22483
This commit is contained in:
Tor Lillqvist 2007-05-13 23:12:52 +00:00 committed by Tor Lillqvist
parent 0a6b6e4890
commit e0719dfd82
3 changed files with 30 additions and 6 deletions

View File

@ -1,3 +1,13 @@
2007-05-14 Tor Lillqvist <tml@novell.com>
* libgimpbase/gimpenv.c: Undef DATADIR before including <shlobj.h>
to avoid collision with DATADIR enum in objidl.h. Define
CSIDL_MYDOCUMENTS, CSIDL_MYMUSIC and CSIDL_MYVIDEO in case missing
from shlobj.h.
* libgimpbase/Makefile.am: Link with -lole32 on Win32 for
CoTaskMemFree().
2007-05-13 Sven Neumann <sven@gimp.org>
* app/widgets/gimpfiledialog.c (gimp_file_dialog_new): add a

View File

@ -5,6 +5,7 @@ no_undefined = -no-undefined
endif
if OS_WIN32
ole32_lib = -lole32
gimpbase_def = gimpbase.def
libgimpbase_export_symbols = -export-symbols gimpbase.def
@ -152,7 +153,7 @@ libgimpbase_2_0_la_LDFLAGS = \
libgimpbase_2_0_la_DEPENDENCIES = $(gimpbase_def)
libgimpbase_2_0_la_LIBADD = $(GLIB_LIBS)
libgimpbase_2_0_la_LIBADD = $(GLIB_LIBS) $(ole32_lib)
install-data-local: install-ms-lib install-libtool-import-lib

View File

@ -45,8 +45,8 @@
#ifdef G_OS_WIN32
#define STRICT
#define WIN32_LEAN_AND_MEAN /* without it DATADIR in objidl.h will collide */
#include <windows.h> /* For GetModuleFileName */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <io.h>
#ifndef S_IWUSR
# define S_IWUSR _S_IWRITE
@ -65,9 +65,7 @@
#define getegid() 0
#endif
#ifdef G_OS_WIN32
#include <shlobj.h>
#else
#ifndef G_OS_WIN32
#include "xdg-user-dir.h"
#endif
@ -406,6 +404,21 @@ gimp_sysconf_directory (void)
}
#ifdef G_OS_WIN32
#undef DATADIR /* Collision otherwise */
#include <shlobj.h>
#ifndef CSIDL_MYDOCUMENTS
#define CSIDL_MYDOCUMENTS 0x000C
#endif
#ifndef CSIDL_MYMUSIC
#define CSIDL_MYMUSIC 0x000D
#endif
#ifndef CSIDL_MYVIDEO
#define CSIDL_MYVIDEO 0x000E
#endif
static gchar *
get_special_folder (int csidl)
{