diff options
Diffstat (limited to 'src/libw32dll')
-rw-r--r-- | src/libw32dll/Makefile.am | 5 | ||||
-rw-r--r-- | src/libw32dll/wine/Makefile.am | 1 | ||||
-rw-r--r-- | src/libw32dll/wine/registry.c | 39 | ||||
-rw-r--r-- | src/libw32dll/wine/windef.h | 7 |
4 files changed, 18 insertions, 34 deletions
diff --git a/src/libw32dll/Makefile.am b/src/libw32dll/Makefile.am index 358eea40a..367dc3bda 100644 --- a/src/libw32dll/Makefile.am +++ b/src/libw32dll/Makefile.am @@ -14,7 +14,9 @@ xineplug_LTLIBRARIES = $(w32dll_codec) $(qt_codec) EXTRA_DIST = common.c xineplug_decode_w32dll_la_SOURCES = w32codec.c +xineplug_decode_w32dll_la_CFLAGS = $(AM_CFLAGS) $(XDG_BASEDIR_CFLAGS) xineplug_decode_w32dll_la_LDFLAGS = -avoid-version -module +xineplug_decode_w32dll_la_DEPS = $(XDG_BASEDIR_DEPS) xineplug_decode_w32dll_la_LIBADD = \ $(top_builddir)/src/libw32dll/wine/libwine.la \ $(XINE_LIB) \ @@ -22,7 +24,8 @@ xineplug_decode_w32dll_la_LIBADD = \ -lm \ $(top_builddir)/src/libw32dll/DirectShow/libds_filter.la \ $(top_builddir)/src/libw32dll/dmo/libdmo_filter.la \ - @KSTAT_LIBS@ + @KSTAT_LIBS@ \ + $(XDG_BASEDIR_LIBS) xineplug_decode_qt_la_SOURCES = qt_decoder.c xineplug_decode_qt_la_LDFLAGS = -avoid-version -module diff --git a/src/libw32dll/wine/Makefile.am b/src/libw32dll/wine/Makefile.am index 63da4068e..b53d2c078 100644 --- a/src/libw32dll/wine/Makefile.am +++ b/src/libw32dll/wine/Makefile.am @@ -35,6 +35,7 @@ libwine_la_SOURCES = \ win32.c \ stubs.s \ wrapper.S +libwine_la_CFLAGS = $(AM_CFLAGS) $(XDG_BASEDIR_CFLAGS) noinst_HEADERS = \ avifmt.h \ diff --git a/src/libw32dll/wine/registry.c b/src/libw32dll/wine/registry.c index 0f91499b3..c8e3c4dd0 100644 --- a/src/libw32dll/wine/registry.c +++ b/src/libw32dll/wine/registry.c @@ -19,6 +19,7 @@ #ifdef XINE_MAJOR #include "xineutils.h" +#include <basedir.h> #endif //#undef TRACE @@ -302,44 +303,22 @@ static struct reg_value* insert_reg_value(int handle, const char* name, int type static void init_registry(void) { + xdgHandle tmph = xdgAllocHandle(); + const char *const xdg_cache_home = xdgCacheHome(tmph); + TRACE("Initializing registry\n"); // can't be free-ed - it's static and probably thread // unsafe structure which is stored in glibc -#ifdef MPLAYER - regpathname = get_path("registry"); - localregpathname = regpathname; -#else -#ifdef XINE_MAJOR - localregpathname = (char *)malloc(strlen(xine_get_homedir()) + 21); - sprintf(localregpathname, "%s/.xine/win32registry", xine_get_homedir()); -#else - // regpathname is an external pointer - // - // registry.c is holding it's own internal pointer - // localregpathname - which is being allocate/deallocated - - if (localregpathname == 0) - { - const char* pthn = regpathname; - if (!regpathname) - { - // avifile - for now reading data from user's home - struct passwd* pwent; - pwent = getpwuid(geteuid()); - pthn = pwent->pw_dir; - } - - localregpathname = (char*)malloc(strlen(pthn)+20); - strcpy(localregpathname, pthn); - strcat(localregpathname, "/.registry"); - } -#endif -#endif + localregpathname = malloc(strlen(xdg_cache_home) + sizeof("/"PACKAGE"/win32registry")); + strcpy(localregpathname, xdg_cache_home); + strcat(localregpathname, "/"PACKAGE"/win32registry"); open_registry(); insert_handle(HKEY_LOCAL_MACHINE, "HKLM"); insert_handle(HKEY_CURRENT_USER, "HKCU"); + + xdgFreeHandle(tmph); } #if 0 diff --git a/src/libw32dll/wine/windef.h b/src/libw32dll/wine/windef.h index e7f691a02..b86f2f740 100644 --- a/src/libw32dll/wine/windef.h +++ b/src/libw32dll/wine/windef.h @@ -7,8 +7,9 @@ #ifndef __WINE_WINDEF_H #define __WINE_WINDEF_H +#include "config.h" + #ifdef __WINE__ -# include "config.h" # undef UNICODE #endif @@ -493,14 +494,14 @@ typedef LRESULT CALLBACK (*WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM); /* Macro for structure packing. */ +#define WINE_PACKED XINE_PACKED + #if defined(__GNUC__) || defined(__ICC) #ifndef _EGCS_ -#define WINE_PACKED __attribute__((packed)) #define WINE_UNUSED __attribute__((unused)) #define WINE_NORETURN __attribute__((noreturn)) #endif #else -#define WINE_PACKED /* nothing */ #define WINE_UNUSED /* nothing */ #define WINE_NORETURN /* nothing */ #endif |