From 55d89deb999b62f0cebacc70fb15b046779a1c09 Mon Sep 17 00:00:00 2001 From: pabs3 Date: Mon, 14 May 2007 23:50:45 +0000 Subject: [PATCH] applied patch #1711089 - disable System::Call and System::Get when building with GCC git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5149 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/System/Source/System.c | 17 +++++++++++++++++ Contrib/System/System.html | 2 ++ Docs/src/build.but | 2 +- Docs/src/usefulinfos.but | 2 ++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Contrib/System/Source/System.c b/Contrib/System/Source/System.c index f4644967..e983c379 100644 --- a/Contrib/System/Source/System.c +++ b/Contrib/System/Source/System.c @@ -5,7 +5,9 @@ #include "Plugin.h" #include "Buffers.h" #include "System.h" +#ifndef __GNUC__ #include +#endif /* __GNUC__ */ #include // Parse Section Type @@ -39,6 +41,15 @@ HINSTANCE g_hInstance; char retexpr[4]; HANDLE retaddr; +#ifndef __GNUC__ + +/* +FIXME: +GCC cannot compile the inline assembly used by System::Call and +System::Get, so those functions and their supporting functions +are disabled when using GCC. +*/ + char *GetResultStr(SystemProc *proc) { char *buf = AllocString(); @@ -250,6 +261,8 @@ PLUGINFUNCTION(Call) GlobalFree((HANDLE) proc); // No, free it } PLUGINFUNCTIONEND +#endif /* __GNUC__ */ + PLUGINFUNCTIONSHORT(Int64Op) { __int64 i1, i2 = 0, i3, i4; @@ -307,6 +320,8 @@ __int64 GetIntFromString(char **p) return myatoi(buffer); } +#ifndef __GNUC__ + SystemProc *PrepareProc(BOOL NeedForCall) { int SectionType = PST_PROC, // First section is always proc spec @@ -1370,6 +1385,8 @@ void CallStruct(SystemProc *proc) proc->Params[0].Value = (int) proc->Proc; } +#endif /* __GNUC__ */ + BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) { g_hInstance=hInst; diff --git a/Contrib/System/System.html b/Contrib/System/System.html index e902e043..c2a95e86 100644 --- a/Contrib/System/System.html +++ b/Contrib/System/System.html @@ -31,6 +31,8 @@

Programming knowledge is highly recommended for good understanding of the System plug-in.

+

The most useful System plug-in functions (Call, Get and Debug) are not available when compiling with GCC. To work around this, either download a MSVC-compiled version or write your own plugin that calls the functions you need.

+

Usage Examples From The Wiki

    diff --git a/Docs/src/build.but b/Docs/src/build.but index ac5168f0..acf5b13d 100644 --- a/Docs/src/build.but +++ b/Docs/src/build.but @@ -83,7 +83,7 @@ If no cross-compiler is available, use the following: This should only build makensis and install it to the directory where a precompiled package, such as the \R{build_nightly}{nightly build} or a \W{http://sourceforge.net/project/showfiles.php?group_id=22049}{zipped release version} (nsis-x.xx.zip), is extracted. Note that the in order for this to work, the precompiled package must be compiled using the exact same sources as makensis. In particular, \c{Source\\exehead\\config.h}, the options passed to scons and \c{Source\\exehead\\fileform.h} must be identical. Nightly builds and zipped release versions are built with the default options. -Currently, the System plug-in \W{http://forums.winamp.com/showthread.php?s=&threadid=227304}{can't be built} using a cross-compiler, but only with MSVC. When building with a cross compiler, always use at least the following flags: +Currently, the Call, Get and Debug functions of the System plug-in \W{http://forums.winamp.com/showthread.php?s=&threadid=227304}{can't be built} using GCC, but only with MSVC. When building with GCC, either download a MSVC-compiled version or write your own plugin that calls the functions you need. You can skip building the System plugin using the following flags: \c scons SKIPPLUGINS=System diff --git a/Docs/src/usefulinfos.but b/Docs/src/usefulinfos.but index 2fc2294b..757f18d9 100644 --- a/Docs/src/usefulinfos.but +++ b/Docs/src/usefulinfos.but @@ -70,6 +70,8 @@ If both NoModify and NoRepair are set to 1, the button displays "Remove" instead \H{useful_system_plugin} Calling an external DLL using the System.dll plug-in +\\Please note that the Call, Get and Debug functions cannot be compiled with GCC, so download the Windows version of NSIS and extract the System.dll plugin or write your own plugin that calls the functions you need.\\ + Some install processes are required to call functions contained inside third party DLLs. A prime example of this is when installing a Palm(TM) conduit. \\Some background about System.dll\\ \\