diff --git a/configure.ac b/configure.ac index e499770..3f325d7 100644 --- a/configure.ac +++ b/configure.ac @@ -85,7 +85,7 @@ else fi case "$host" in - *-mingw32) + *-mingw32|*-pc-msys) EXEEXT=".exe" DLLPREFIX="" @@ -106,6 +106,8 @@ case "$host" in STATIC_LDFLAGS="-static-libstdc++ -static-libgcc -static" DLL_LDFLAGS="-shared -Wl,--add-stdcall-alias" + AC_DEFINE(ENABLE_WINDOWS_REGISTRY) + AC_CONFIG_FILES(win/makeruntime.sh) AC_CONFIG_FILES(win/copydeps.sh) AC_CONFIG_FILES(win/$PACKAGE_TARNAME.nsi) @@ -239,7 +241,7 @@ AC_CHECK_HEADER(libintl.h, [ AC_DEFINE(HAVE_LIBINTL, 1) case "$host" in - *-mingw32) + *-mingw32|*-pc-msys) INTL_LIBS="-lintl" ;; @@ -376,7 +378,7 @@ AC_ARG_ENABLE([pic], esac dnl case "$host" in -dnl *-mingw32) +dnl *-mingw32|*-pc-msys) dnl app_cv_pic="no" dnl ;; dnl @@ -449,7 +451,7 @@ AC_ARG_WITH([inet-ntop], [AS_HELP_STRING([--with-inet-ntop], [Assume that inet_n if test "$app_cv_inet_ntop" == "auto"; then case "$host" in - *-mingw32) + *-mingw32|*-pc-msys) app_cv_inet_ntop="yes" ;; diff --git a/src/include/config.h.in b/src/include/config.h.in index c99be6e..9e9bda0 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -53,8 +53,8 @@ #undef SSL_ENABLE_CRL_CHECK #ifdef WIN32 - #undef HAVE_WIN_REGISTRY -#endif // HAVE_WIN_REGISTRY + #undef ENABLE_WINDOWS_REGISTRY +#endif // ENABLE_WINDOWS_REGISTRY #undef HAVE_GNOME diff --git a/src/pw3270/common/common.h b/src/pw3270/common/common.h index e998b3f..d9245f1 100644 --- a/src/pw3270/common/common.h +++ b/src/pw3270/common/common.h @@ -87,14 +87,14 @@ void restore_window_from_config(const gchar *group, const gchar *key, GtkWidget *hwnd); -#ifdef HAVE_WIN_REGISTRY +#ifdef ENABLE_WINDOWS_REGISTRY gboolean get_registry_handle(const gchar *group, HKEY *hKey, REGSAM samDesired); void registry_foreach(HKEY parent, const gchar *name,void (*cbk)(const gchar *key, const gchar *val, gpointer *user_data), gpointer *user_data); void registry_set_double(HKEY hKey, const gchar *key, gdouble value); gboolean registry_get_double(HKEY hKey, const gchar *key, gdouble *value); #else GKeyFile * get_application_keyfile(void); -#endif // HAVE_WIN_REGISTRY +#endif // ENABLE_WINDOWS_REGISTRY #endif diff --git a/src/pw3270/common/config.c b/src/pw3270/common/config.c index 31152e4..c0e53af 100644 --- a/src/pw3270/common/config.c +++ b/src/pw3270/common/config.c @@ -43,7 +43,6 @@ #ifdef WIN32 #include - // #define HAVE_WIN_REGISTRY 1 #ifndef KEY_WOW64_64KEY #define KEY_WOW64_64KEY 0x0100 @@ -57,7 +56,7 @@ /*--[ Globals ]--------------------------------------------------------------------------------------*/ -#ifdef HAVE_WIN_REGISTRY +#ifdef ENABLE_WINDOWS_REGISTRY static const gchar * registry_path = "SOFTWARE"; @@ -65,11 +64,11 @@ static GKeyFile * program_config = NULL; -#endif // HAVE_WIN_REGISTRY +#endif // ENABLE_WINDOWS_REGISTRY /*--[ Implement ]------------------------------------------------------------------------------------*/ -#ifdef HAVE_WIN_REGISTRY +#ifdef ENABLE_WINDOWS_REGISTRY enum REG_KEY { @@ -270,11 +269,11 @@ return g_build_filename(g_get_user_config_dir(),name,NULL); } -#endif // #ifdef HAVE_WIN_REGISTRY +#endif // #ifdef ENABLE_WINDOWS_REGISTRY gboolean get_boolean_from_config(const gchar *group, const gchar *key, gboolean def) { -#ifdef HAVE_WIN_REGISTRY +#ifdef ENABLE_WINDOWS_REGISTRY gboolean ret = def; HKEY hKey; @@ -308,14 +307,14 @@ else return val; } -#endif // HAVE_WIN_REGISTRY +#endif // ENABLE_WINDOWS_REGISTRY return def; } gint get_integer_from_config(const gchar *group, const gchar *key, gint def) { -#ifdef HAVE_WIN_REGISTRY +#ifdef ENABLE_WINDOWS_REGISTRY HKEY key_handle; @@ -351,7 +350,7 @@ else return val; } -#endif // HAVE_WIN_REGISTRY +#endif // ENABLE_WINDOWS_REGISTRY return def; } @@ -359,7 +358,7 @@ gchar * get_string_from_config(const gchar *group, const gchar *key, const gchar *def) { -#ifdef HAVE_WIN_REGISTRY +#ifdef ENABLE_WINDOWS_REGISTRY HKEY key_handle; unsigned long datalen = 4096; @@ -406,12 +405,12 @@ return NULL; -#endif // HAVE_WIN_REGISTRY +#endif // ENABLE_WINDOWS_REGISTRY } void configuration_init(void) { -#ifndef HAVE_WIN_REGISTRY +#ifndef ENABLE_WINDOWS_REGISTRY gchar *filename = search_for_ini(); if(program_config) @@ -426,14 +425,14 @@ void configuration_init(void) g_free(filename); } -#endif // HAVE_WIN_REGISTRY +#endif // ENABLE_WINDOWS_REGISTRY } static void set_string(const gchar *group, const gchar *key, const gchar *fmt, va_list args) { gchar * value = g_strdup_vprintf(fmt,args); -#ifdef HAVE_WIN_REGISTRY +#ifdef ENABLE_WINDOWS_REGISTRY gchar * path = g_strdup_printf("%s\\%s\\%s",registry_path,g_get_application_name(),group); HKEY hKey; @@ -466,7 +465,7 @@ void set_string_to_config(const gchar *group, const gchar *key, const gchar *fmt void set_boolean_to_config(const gchar *group, const gchar *key, gboolean val) { -#ifdef HAVE_WIN_REGISTRY +#ifdef ENABLE_WINDOWS_REGISTRY HKEY hKey; DWORD disp; @@ -502,13 +501,13 @@ void set_boolean_to_config(const gchar *group, const gchar *key, gboolean val) if(program_config) g_key_file_set_boolean(program_config,group,key,val); -#endif // HAVE_WIN_REGISTRY +#endif // ENABLE_WINDOWS_REGISTRY } void set_integer_to_config(const gchar *group, const gchar *key, gint val) { -#ifdef HAVE_WIN_REGISTRY +#ifdef ENABLE_WINDOWS_REGISTRY HKEY hKey; DWORD disp; @@ -544,13 +543,13 @@ void set_integer_to_config(const gchar *group, const gchar *key, gint val) if(program_config) g_key_file_set_integer(program_config,group,key,val); -#endif // HAVE_WIN_REGISTRY +#endif // ENABLE_WINDOWS_REGISTRY } void configuration_deinit(void) { -#ifdef HAVE_WIN_REGISTRY +#ifdef ENABLE_WINDOWS_REGISTRY #else @@ -576,7 +575,7 @@ void configuration_deinit(void) g_key_file_free(program_config); program_config = NULL; -#endif // HAVE_WIN_REGISTRY +#endif // ENABLE_WINDOWS_REGISTRY } gchar * build_data_filename(const gchar *first_element, ...) @@ -606,7 +605,7 @@ gchar * filename_from_va(const gchar *first_element, va_list args) g_autofree gchar * suffix = g_string_free(result, FALSE); -#if defined( HAVE_WIN_REGISTRY ) +#if defined( ENABLE_WINDOWS_REGISTRY ) for(p=0;phSession,data->text); + if(!trace_window) + trace_window = v3270_trace_new_from_session(data->hSession,data->text); - v3270_trace_set_destroy_on_close(widget,TRUE); + v3270_trace_set_destroy_on_close(trace_window,TRUE); - g_signal_connect(widget, "destroy", G_CALLBACK(trace_window_destroy), data->hSession); + g_signal_connect(trace_window, "destroy", G_CALLBACK(trace_window_destroy), data->hSession); - gtk_widget_show_all(widget); + gtk_widget_show_all(trace_window); g_free(data->text); return FALSE; } - static void trace_window(G_GNUC_UNUSED H3270 *hSession, G_GNUC_UNUSED void * userdata, const char *fmt, va_list args) + static void trace_on_window(G_GNUC_UNUSED H3270 *hSession, G_GNUC_UNUSED void * userdata, const char *fmt, va_list args) { struct trace_data * data = g_new0(struct trace_data,1); @@ -296,11 +244,11 @@ if(tracefile) { - lib3270_set_trace_handler(pw3270_get_session(widget),trace_file,(void *) widget); + lib3270_set_trace_handler(pw3270_get_session(widget),trace_on_file,(void *) widget); } else { - lib3270_set_trace_handler(pw3270_get_session(widget),trace_window,(void *) widget); + lib3270_set_trace_handler(pw3270_get_session(widget),trace_on_window,(void *) widget); } if(host) -- libgit2 0.21.2