From b8c02f71d9bbaf805534d5327d8c3935a3b87636 Mon Sep 17 00:00:00 2001 From: TingPing Date: Wed, 4 Jun 2014 10:30:18 -0400 Subject: win32: Use config.h instead of config-win32.h --- config-win32.h.tt | 18 ------------------ plugins/perl/perl.c | 5 +---- plugins/python/python.c | 2 +- src/common/common.vcxproj | 6 +++--- src/common/common.vcxproj.filters | 4 ++-- src/common/hexchat.h | 4 ---- src/common/inet.h | 2 +- src/common/network.c | 6 ++---- src/common/ssl.c | 4 +--- src/common/util.c | 3 +-- src/fe-gtk/fe-gtk.h | 4 ---- src/fe-gtk/fe-gtk.vcxproj | 2 +- src/fe-gtk/hexchat.rc.tt | 2 +- src/fe-gtk/sexy-iso-codes.c | 5 ----- src/fe-gtk/xtext.c | 5 ----- version-template.ps1 | 12 ------------ win32/config.h.tt | 18 ++++++++++++++++++ win32/version-template.ps1 | 12 ++++++++++++ 18 files changed, 44 insertions(+), 70 deletions(-) delete mode 100644 config-win32.h.tt delete mode 100644 version-template.ps1 create mode 100644 win32/config.h.tt create mode 100644 win32/version-template.ps1 diff --git a/config-win32.h.tt b/config-win32.h.tt deleted file mode 100644 index 77da3b38..00000000 --- a/config-win32.h.tt +++ /dev/null @@ -1,18 +0,0 @@ -#define LOCALEDIR ".\\share\\locale" -#define ENABLE_NLS -#define USE_PLUGIN -#define USE_OPENSSL -#define USE_IPV6 -#define HAVE_ISO_CODES -#define ISO_CODES_PREFIX ".\\" -#define ISO_CODES_LOCALEDIR LOCALEDIR -#define PACKAGE_NAME "hexchat" -#define PACKAGE_VERSION "<#= [string]::Join('.', $versionParts) #>" -#define HEXCHATLIBDIR ".\\plugins" -#define HEXCHATSHAREDIR "." -#define OLD_PERL -#define GETTEXT_PACKAGE "hexchat" -#define PACKAGE_TARNAME "hexchat-<#= [string]::Join('.', $versionParts) #>" -#ifndef USE_IPV6 -#define socklen_t int -#endif diff --git a/plugins/perl/perl.c b/plugins/perl/perl.c index 6711bd68..74333516 100644 --- a/plugins/perl/perl.c +++ b/plugins/perl/perl.c @@ -32,11 +32,8 @@ #endif #undef PACKAGE -#ifdef WIN32 -#include "../../config-win32.h" /* for #define OLD_PERL */ -#else #include "../../config.h" -#endif + #include "hexchat-plugin.h" static hexchat_plugin *ph; /* plugin handle */ diff --git a/plugins/python/python.c b/plugins/python/python.c index 28a40d18..06cc7a3b 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -60,12 +60,12 @@ #include #include #include "../../src/dirent/dirent-win32.h" -#include "../../config-win32.h" #else #include #include #endif +#include "../../config.h" #include "hexchat-plugin.h" #undef _POSIX_C_SOURCE /* Avoid warning: also in /usr/include/features.h from glib.h */ #include diff --git a/src/common/common.vcxproj b/src/common/common.vcxproj index c38f432b..fe0887d5 100644 --- a/src/common/common.vcxproj +++ b/src/common/common.vcxproj @@ -77,8 +77,8 @@ - - + + {87554B59-006C-4D94-9714-897B27067BA3} @@ -160,7 +160,7 @@ "$(ProjectDir)marshal.h" "$(DepsRoot)\bin\glib-genmarshal.exe" --prefix=_hexchat_marshal --body "$(ProjectDir)marshalers.list" > "$(ProjectDir)marshal.c" diff --git a/src/common/common.vcxproj.filters b/src/common/common.vcxproj.filters index 800d8daa..c2d0ce5d 100644 --- a/src/common/common.vcxproj.filters +++ b/src/common/common.vcxproj.filters @@ -104,7 +104,7 @@ Header Files - + Header Files @@ -195,6 +195,6 @@ - + \ No newline at end of file diff --git a/src/common/hexchat.h b/src/common/hexchat.h index 44531468..899d1eaa 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -17,11 +17,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifdef WIN32 -#include "../../config-win32.h" -#else #include "../../config.h" -#endif #include #include diff --git a/src/common/inet.h b/src/common/inet.h index e95a375f..990415be 100644 --- a/src/common/inet.h +++ b/src/common/inet.h @@ -47,7 +47,7 @@ #else -#include "../../config-win32.h" +#include "../../config.h" #ifdef USE_IPV6 #include #include diff --git a/src/common/network.c b/src/common/network.c index ca0923e1..8790f673 100644 --- a/src/common/network.c +++ b/src/common/network.c @@ -23,12 +23,10 @@ #include #include -#ifdef WIN32 -#include "../../config-win32.h" /* grab USE_IPV6 and LOOKUPD defines */ -#else +#ifndef WIN32 #include -#include "../../config.h" #endif +#include "../../config.h" #define WANTSOCKET #define WANTARPA diff --git a/src/common/ssl.c b/src/common/ssl.c index d036fb66..71d4f1da 100644 --- a/src/common/ssl.c +++ b/src/common/ssl.c @@ -27,10 +27,8 @@ #include /* ERR_() */ #ifdef WIN32 #include /* RAND_seed() */ -#include "../../config-win32.h" /* HAVE_SNPRINTF */ -#else -#include "../../config.h" #endif +#include "../../config.h" #include /* asctime() */ #include /* strncpy() */ #include "ssl.h" /* struct cert_info */ diff --git a/src/common/util.c b/src/common/util.c index 4582eec6..69ddaff4 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -35,16 +35,15 @@ #include #include #include "../dirent/dirent-win32.h" -#include "../../config-win32.h" #else #include #include #include #include #include -#include "../../config.h" #endif +#include "../../config.h" #include #include #include "hexchat.h" diff --git a/src/fe-gtk/fe-gtk.h b/src/fe-gtk/fe-gtk.h index 9bf0a57f..c93ec1c6 100644 --- a/src/fe-gtk/fe-gtk.h +++ b/src/fe-gtk/fe-gtk.h @@ -20,11 +20,7 @@ #ifndef HEXCHAT_FE_GTK_H #define HEXCHAT_FE_GTK_H -#ifdef WIN32 -#include "../../config-win32.h" -#else #include "../../config.h" -#endif #define DISPLAY_NAME "HexChat" diff --git a/src/fe-gtk/fe-gtk.vcxproj b/src/fe-gtk/fe-gtk.vcxproj index 6ac3cb58..e1d82ff0 100644 --- a/src/fe-gtk/fe-gtk.vcxproj +++ b/src/fe-gtk/fe-gtk.vcxproj @@ -99,7 +99,7 @@ -#include "../../config-win32.h" +#include "../../config.h" #define COMMA_VERSION <#= [string]::Join(',', $versionParts) #>,0 diff --git a/src/fe-gtk/sexy-iso-codes.c b/src/fe-gtk/sexy-iso-codes.c index b93ffc2b..e6acb726 100644 --- a/src/fe-gtk/sexy-iso-codes.c +++ b/src/fe-gtk/sexy-iso-codes.c @@ -22,12 +22,7 @@ #include "sexy-iso-codes.h" #include #include - -#ifdef G_OS_WIN32 -#include "../../config-win32.h" -#else #include "../../config.h" -#endif #define ISO_639_DOMAIN "iso_639" #define ISO_3166_DOMAIN "iso_3166" diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c index 360a1420..6a3c1ac9 100644 --- a/src/fe-gtk/xtext.c +++ b/src/fe-gtk/xtext.c @@ -31,12 +31,7 @@ #include #include -#ifdef WIN32 -#include "../../config-win32.h" -#else #include "../../config.h" -#endif - #include "../common/hexchat.h" #include "../common/fe.h" #include "../common/util.h" diff --git a/version-template.ps1 b/version-template.ps1 deleted file mode 100644 index 18eb90d9..00000000 --- a/version-template.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -param ([string] $templateFilename, [string] $outputFilename) - -$versionParts = Select-String -Path "${env:SOLUTIONDIR}configure.ac" -Pattern '^AC_INIT\(\[HexChat\],\[([^]]+)\]\)$' | Select-Object -First 1 | %{ $_.Matches[0].Groups[1].Value.Split('.') } - -[string[]] $contents = Get-Content $templateFilename -Encoding UTF8 | %{ - while ($_ -match '^(.*?)<#=(.*?)#>(.*?)$') { - $_ = $Matches[1] + $(Invoke-Expression $Matches[2]) + $Matches[3] - } - $_ -} - -[System.IO.File]::WriteAllLines($outputFilename, $contents) diff --git a/win32/config.h.tt b/win32/config.h.tt new file mode 100644 index 00000000..77da3b38 --- /dev/null +++ b/win32/config.h.tt @@ -0,0 +1,18 @@ +#define LOCALEDIR ".\\share\\locale" +#define ENABLE_NLS +#define USE_PLUGIN +#define USE_OPENSSL +#define USE_IPV6 +#define HAVE_ISO_CODES +#define ISO_CODES_PREFIX ".\\" +#define ISO_CODES_LOCALEDIR LOCALEDIR +#define PACKAGE_NAME "hexchat" +#define PACKAGE_VERSION "<#= [string]::Join('.', $versionParts) #>" +#define HEXCHATLIBDIR ".\\plugins" +#define HEXCHATSHAREDIR "." +#define OLD_PERL +#define GETTEXT_PACKAGE "hexchat" +#define PACKAGE_TARNAME "hexchat-<#= [string]::Join('.', $versionParts) #>" +#ifndef USE_IPV6 +#define socklen_t int +#endif diff --git a/win32/version-template.ps1 b/win32/version-template.ps1 new file mode 100644 index 00000000..18eb90d9 --- /dev/null +++ b/win32/version-template.ps1 @@ -0,0 +1,12 @@ +param ([string] $templateFilename, [string] $outputFilename) + +$versionParts = Select-String -Path "${env:SOLUTIONDIR}configure.ac" -Pattern '^AC_INIT\(\[HexChat\],\[([^]]+)\]\)$' | Select-Object -First 1 | %{ $_.Matches[0].Groups[1].Value.Split('.') } + +[string[]] $contents = Get-Content $templateFilename -Encoding UTF8 | %{ + while ($_ -match '^(.*?)<#=(.*?)#>(.*?)$') { + $_ = $Matches[1] + $(Invoke-Expression $Matches[2]) + $Matches[3] + } + $_ +} + +[System.IO.File]::WriteAllLines($outputFilename, $contents) -- cgit 1.4.1