From: Yaakov Selkowitz Date: Tue, 10 Aug 2010 20:38:01 +0000 (+0000) Subject: Fix compatibility with GCC 4.x. X-Git-Tag: release_2.869~162 X-Git-Url: https://cygwin.com/git/?a=commitdiff_plain;h=10b2d0511640191ac2a7f619d85e63768601d603;p=cygwin-apps%2Fsetup.git 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. --- diff --git a/ChangeLog b/ChangeLog index 70098138..f22ee982 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2010-08-10 Yaakov Selkowitz + + 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 * Makefile.am: Treat libgetopt++ as full-fledged SUBDIRS. diff --git a/Makefile.am b/Makefile.am index 374fa119..2a2c4fac 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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) diff --git a/localdir.cc b/localdir.cc index 3a18ff01..5fe84b90 100644 --- a/localdir.cc +++ b/localdir.cc @@ -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(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(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]; diff --git a/mklink2.cc b/mklink2.cc index 037fda77..57c54369 100644 --- a/mklink2.cc +++ b/mklink2.cc @@ -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 b1a0de37..a6d1cd6b 100644 --- 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" diff --git a/package_message.h b/package_message.h index ec76f970..97e9f346 100644 --- a/package_message.h +++ b/package_message.h @@ -15,6 +15,7 @@ #include "UserSettings.h" #include "state.h" +#include #include class packagemessage