]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
Fix compatibility with GCC 4.x.
authorYaakov Selkowitz <yselkowi@redhat.com>
Tue, 10 Aug 2010 20:38:01 +0000 (20:38 +0000)
committerYaakov Selkowitz <yselkowi@redhat.com>
Tue, 10 Aug 2010 20:38:01 +0000 (20:38 +0000)
* Makefile.am (setup_LDFLAGS): Pass -static to compiler instead of
linker so that libgcc is statically linked as well.
(autoload.o): Disable optimization.
* localdir.cc (browse_cb): Fix "jump to case label crosses
initialization" error.
* mklink2.cc (sfli): Fix "non-local variable uses anonymous type"
warning.
* ntdll.h: Fix "redeclared without dllimport attribute: previous
dllimport ignored" warnings.
* package_message.h (display): Fix "'exit' was not declared in this
scope" error.

ChangeLog
Makefile.am
localdir.cc
mklink2.cc
ntdll.h
package_message.h

index 70098138b9be4e7086e37772d5a2f10520b358dc..f22ee982475459c9e023422cbcb1a718063fffb9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2010-08-10  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
+
+       Fix compatibility with GCC 4.x.
+       * Makefile.am (setup_LDFLAGS): Pass -static to compiler instead of
+       linker so that libgcc is statically linked as well.
+       (autoload.o): Disable optimization.
+       * localdir.cc (browse_cb): Fix "jump to case label crosses
+       initialization" error.
+       * mklink2.cc (sfli): Fix "non-local variable uses anonymous type"
+       warning.
+       * ntdll.h: Fix "redeclared without dllimport attribute: previous
+       dllimport ignored" warnings.
+       * package_message.h (display): Fix "'exit' was not declared in this
+       scope" error.
+
 2010-08-10  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
 
        * Makefile.am: Treat libgetopt++ as full-fledged SUBDIRS.
index 374fa119df239bcc7f8ddd0e7828eb905a79fc9c..2a2c4fac69d13b0a52217675f14f785ec68db402 100644 (file)
@@ -114,7 +114,7 @@ setup_LDADD = \
        libinilex.a \
        libgetopt++/libgetopt++.la -lgcrypt -lgpg-error \
        -lshlwapi -lcomctl32 -lole32 -lwsock32 -lnetapi32 -luuid -llzma -lbz2 -lz 
-setup_LDFLAGS = -mwindows -Wl,-static -static-libtool-libs
+setup_LDFLAGS = -mwindows -Wc,-static -static-libtool-libs
 setup_SOURCES = \
        AntiVirus.cc \
        AntiVirus.h \
@@ -283,6 +283,9 @@ setup_SOURCES = \
        libmd5-rfc/md5.c \
        libmd5-rfc/md5.h
 
+# autoload code does not optimize properly with gcc-4.x
+autoload.o: CFLAGS += -O0
+
 VER := $(shell sed -ne 's/^\$$Revi[s]ion: *\([^ ]*\) *$$.*/\1/p' \
                $(srcdir)/ChangeLog)
 
index 3a18ff019e8f27116e71a33f38ad2e6dbef13049..5fe84b908f2081ab6dbc9e93d359af687bc7a272 100644 (file)
@@ -152,12 +152,14 @@ browse_cb (HWND h, UINT msg, LPARAM lp, LPARAM data)
        SendMessage (h, BFFM_SETSELECTION, TRUE, (LPARAM) local_dir.c_str());
       break;
     case BFFM_SELCHANGED:
-      // Make a note of each new dir we successfully select, so that
-      // we know where to create the new directory if an invalid name
-      // is entered in the text box.
-      LPITEMIDLIST pidl = reinterpret_cast<LPITEMIDLIST>(lp);
-      SHGetPathFromIDList (pidl, dirname);
-      break;
+      {
+        // Make a note of each new dir we successfully select, so that
+        // we know where to create the new directory if an invalid name
+        // is entered in the text box.
+        LPITEMIDLIST pidl = reinterpret_cast<LPITEMIDLIST>(lp);
+        SHGetPathFromIDList (pidl, dirname);
+        break;
+      }
     case BFFM_VALIDATEFAILED:
       // See if user wants to create a dir in the last successfully-selected.
       CHAR tempname[MAX_PATH];
index 037fda770be303de41487f6292b1be28d618ff57..57c543692aef36cf033d915711f5ee78d30054a7 100644 (file)
@@ -111,7 +111,7 @@ mkcygsymlink (const char *from, const char *to)
                        : mkcygsymlink_9x (from, to);
 }
 
-struct {
+static struct {
   FILE_LINK_INFORMATION fli;
   WCHAR namebuf[32768];
 } sfli;
diff --git a/ntdll.h b/ntdll.h
index b1a0de3755579e978ab5b964d36e849a61f1d7e8..a6d1cd6b705563c1037f336689da224a8617e22a 100644 (file)
--- a/ntdll.h
+++ b/ntdll.h
@@ -14,6 +14,8 @@
 #ifndef SETUP_NTDLL_H
 #define SETUP_NTDLL_H
 
+#define NTOSAPI
+
 #include "ddk/ntapi.h"
 #include "ddk/ntifs.h"
 
index ec76f97084d0d524bdacde079cf4facd6668a4a9..97e9f346d079d1f43ea2b7bf888e49c304f12f93 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "UserSettings.h"
 #include "state.h"
+#include <stdlib.h>
 #include <windows.h>
 
 class packagemessage
This page took 0.04663 seconds and 5 git commands to generate.