diff options
Diffstat (limited to 'src/libw32dll/wine')
-rw-r--r-- | src/libw32dll/wine/Makefile.am | 57 | ||||
-rw-r--r-- | src/libw32dll/wine/registry.c | 39 | ||||
-rw-r--r-- | src/libw32dll/wine/windef.h | 7 |
3 files changed, 37 insertions, 66 deletions
diff --git a/src/libw32dll/wine/Makefile.am b/src/libw32dll/wine/Makefile.am index 63da4068e..1756e3262 100644 --- a/src/libw32dll/wine/Makefile.am +++ b/src/libw32dll/wine/Makefile.am @@ -1,40 +1,13 @@ include $(top_srcdir)/misc/Makefile.common -LIBTOOL = $(SHELL) $(top_builddir)/libtool - -EXTRA_DIST = stubs.s wrapper.S - -noinst_LTLIBRARIES = $(wine_lib) - -AM_CFLAGS = $(X_CFLAGS) @W32_NO_OPTIMIZE@ \ - -Wmissing-prototypes -Wimplicit-function-declaration \ - -DWIN32_PATH=\"@w32_path@\" -I$(srcdir)/.. -D__WINE__ \ +# disable -fomit-frame-pointer, -finline-functions, and -frename-registers +# because they cause bad behavior of wine +AM_CFLAGS = $(DEFAULT_OCFLAGS) $(X_CFLAGS) @W32_NO_OPTIMIZE@ \ + -fno-omit-frame-pointer -fno-inline-functions -fno-rename-registers +AM_CPPFLAGS = -DWIN32_PATH=\"$(w32_path)\" -I$(srcdir)/.. -D__WINE__ \ -Ddbg_printf=__vprintf -DTRACE=__vprintf -# CFLAGS is here to filter out -fomit-frame-pointer, -# -finline-functions and -frename-registers because they cause bad -# behavior of wine -CFLAGS = `echo @CFLAGS@ | sed -e 's/-fomit-frame-pointer//g;s/-finline-functions//g;s/-frename-registers//g'` - -if HAVE_W32DLL -wine_lib = libwine.la -endif - -libwine_la_SOURCES = \ - afl.c \ - driver.c \ - elfdll.c \ - ext.c \ - ldt_keeper.c \ - module.c \ - pe_image.c \ - pe_resource.c \ - resource.c \ - registry.c \ - vfl.c \ - win32.c \ - stubs.s \ - wrapper.S +EXTRA_DIST = stubs.s wrapper.S noinst_HEADERS = \ avifmt.h \ @@ -74,3 +47,21 @@ noinst_HEADERS = \ winuser.h \ wrapper.h +noinst_LTLIBRARIES = libwine.la + +libwine_la_SOURCES = \ + afl.c \ + driver.c \ + elfdll.c \ + ext.c \ + ldt_keeper.c \ + module.c \ + pe_image.c \ + pe_resource.c \ + resource.c \ + registry.c \ + vfl.c \ + win32.c \ + stubs.s \ + wrapper.S +libwine_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS) 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 |