diff --git a/SCons/config.py b/SCons/config.py index 42c60e6d..847e34cb 100644 --- a/SCons/config.py +++ b/SCons/config.py @@ -28,6 +28,14 @@ cfg.Add( ) ) +cfg.Add( + ( + 'NSIS_VARS_SECTION', + 'defines the name of the PE section containing the runtime variables', + '.ndata' + ) +) + cfg.Add( BoolOption( 'NSIS_CONFIG_UNINSTALL_SUPPORT', @@ -426,6 +434,7 @@ def AddBoolDefine(define): AddValuedDefine('NSIS_MAX_STRLEN') AddValuedDefine('NSIS_MAX_INST_TYPES') AddValuedDefine('NSIS_DEFAULT_LANG') +AddValuedDefine('NSIS_VARS_SECTION') AddBoolDefine('NSIS_CONFIG_UNINSTALL_SUPPORT') AddBoolDefine('NSIS_CONFIG_LICENSEPAGE') diff --git a/Source/build.cpp b/Source/build.cpp index 2d96ddfa..c9241919 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -2372,9 +2372,9 @@ int CEXEBuild::write_output(void) VerifyDeclaredUserVarRefs(&m_UserVarNames); int MaxUserVars = m_UserVarNames.getnum(); // -1 because the default size is 1 - if (!res_editor->AddExtraVirtualSize2PESection(VARS_SECTION_NAME, (MaxUserVars - 1) * sizeof(NSIS_STRING))) + if (!res_editor->AddExtraVirtualSize2PESection(NSIS_VARS_SECTION, (MaxUserVars - 1) * sizeof(NSIS_STRING))) { - ERROR_MSG("Internal compiler error #12346: invalid exehead cannot find section \"%s\"!\n", VARS_SECTION_NAME); + ERROR_MSG("Internal compiler error #12346: invalid exehead cannot find section \"%s\"!\n", NSIS_VARS_SECTION); return PS_ERROR; } diff --git a/Source/exehead/config.h b/Source/exehead/config.h index 663bb44c..e0282f51 100644 --- a/Source/exehead/config.h +++ b/Source/exehead/config.h @@ -126,8 +126,6 @@ #define NSIS_DEFAULT_LANG 1033 #endif -#define VARS_SECTION_NAME ".ndata" - typedef char NSIS_STRING[NSIS_MAX_STRLEN]; #endif//!APSTUDIO_INVOKED diff --git a/Source/exehead/util.c b/Source/exehead/util.c index 79bb4d8a..ab17b554 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -21,13 +21,13 @@ char g_log_file[1024]; // which result in extra memory for extra variables without code to do allocation :) // nsis then removes the "DISCARDABLE" style from section (for safe) #ifdef _MSC_VER -# pragma bss_seg(VARS_SECTION_NAME) +# pragma bss_seg(NSIS_VARS_SECTION) NSIS_STRING g_usrvars[1]; # pragma bss_seg() -# pragma comment(linker, "/section:" VARS_SECTION_NAME ",rwd") +# pragma comment(linker, "/section:" NSIS_VARS_SECTION ",rwd") #else # ifdef __GNUC__ -NSIS_STRING g_usrvars[1] __attribute__((section (VARS_SECTION_NAME))); +NSIS_STRING g_usrvars[1] __attribute__((section (NSIS_VARS_SECTION))); # else # error Unknown compiler. You must implement the seperate PE section yourself. # endif