Make winvnc4 and Windows vncconfig compilable via MinGW.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3913 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/win/vncconfig/Connections.h b/win/vncconfig/Connections.h
index 7512cc6..209e4fd 100644
--- a/win/vncconfig/Connections.h
+++ b/win/vncconfig/Connections.h
@@ -62,7 +62,7 @@
         pattern.replaceBuf(0);
       }
       bool onOk() {
-        TCharArray host = getItemString(IDC_HOST_PATTERN);
+        TCharArray host(getItemString(IDC_HOST_PATTERN));
         TCharArray newPat(_tcslen(host.buf)+2);
         if (isItemChecked(IDC_ALLOW))
           newPat.buf[0] = _T('+');
@@ -248,8 +248,8 @@
       }
       bool isChanged() {
         try {
-          CharArray new_hosts = getHosts();
-          CharArray old_hosts = hosts.getData();
+          CharArray new_hosts(getHosts());
+          CharArray old_hosts(hosts.getData());
           return (strcmp(new_hosts.buf, old_hosts.buf) != 0) ||
               (localHost != isItemChecked(IDC_LOCALHOST)) ||
               (port_number != getItemInt(IDC_PORT)) ||
diff --git a/win/vncconfig/Desktop.h b/win/vncconfig/Desktop.h
index 164269a..6479cb2 100644
--- a/win/vncconfig/Desktop.h
+++ b/win/vncconfig/Desktop.h
@@ -32,7 +32,7 @@
       DesktopPage(const RegKey& rk)
         : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_DESKTOP)), regKey(rk) {}
       void initDialog() {
-        CharArray action = rfb::win32::SDisplay::disconnectAction.getData();
+        CharArray action(rfb::win32::SDisplay::disconnectAction.getData());
         bool disconnectLock = stricmp(action.buf, "Lock") == 0;
         bool disconnectLogoff = stricmp(action.buf, "Logoff") == 0;
         typedef BOOL (WINAPI *_LockWorkStation_proto)();
@@ -59,7 +59,7 @@
         case IDC_REMOVE_WALLPAPER:
         case IDC_REMOVE_PATTERN:
         case IDC_DISABLE_EFFECTS:
-          CharArray action = rfb::win32::SDisplay::disconnectAction.getData();
+          CharArray action(rfb::win32::SDisplay::disconnectAction.getData());
           bool disconnectLock = stricmp(action.buf, "Lock") == 0;
           bool disconnectLogoff = stricmp(action.buf, "Logoff") == 0;
           setChanged((disconnectLogoff != isItemChecked(IDC_DISCONNECT_LOGOFF)) ||
diff --git a/win/vncconfig/Legacy.cxx b/win/vncconfig/Legacy.cxx
index ae5d716..f8c2028 100644
--- a/win/vncconfig/Legacy.cxx
+++ b/win/vncconfig/Legacy.cxx
@@ -71,7 +71,7 @@
 
             // Reformat AuthHosts to Hosts.  Wish I'd left the format the same. :( :( :(
             try {
-              CharArray tmp = strDup(authHosts.buf);
+              CharArray tmp(authHosts.buf);
               while (tmp.buf) {
 
                 // Split the AuthHosts string into patterns to match
diff --git a/win/vncconfig/Makefile.am b/win/vncconfig/Makefile.am
new file mode 100644
index 0000000..17420b0
--- /dev/null
+++ b/win/vncconfig/Makefile.am
@@ -0,0 +1,20 @@
+bin_PROGRAMS = vncconfig

+

+HDRS = Authentication.h Connections.h Desktop.h Hooking.h Inputs.h Legacy.h \

+	PasswordDialog.h resource.h Sharing.h

+

+vncconfig_SOURCES = $(HDRS) Legacy.cxx PasswordDialog.cxx vncconfig.cxx

+

+vncconfig_CPPFLAGS = -I$(top_srcdir)/win -I$(top_srcdir)/common

+

+vncconfig_LDADD = $(top_srcdir)/win/rfb_win32/librfb_win32.la \

+	$(top_srcdir)/common/rfb/librfb.la \

+	$(top_srcdir)/common/Xregion/libXregion.la \

+	$(top_srcdir)/common/network/libnetwork.la \

+	$(top_srcdir)/common/rdr/librdr.la -lws2_32 -lgdi32 -lversion -lole32 \

+	-lcomctl32 resources.o

+

+EXTRA_DIST = connected.ico vncconfig.ico vncconfig.rc vncconfig.exe.manifest

+

+resources.o: vncconfig.rc

+	$(WINDRES) $^ -o $@