more of patch #1644712 - new compiler predefines

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4999 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-03-18 18:33:28 +00:00
parent 6842d80d30
commit 576446db5e
3 changed files with 24 additions and 13 deletions

View file

@ -276,7 +276,7 @@ Defined as the function name, without any prefixes, in \R{ffunction}{function} s
\S2{} $\{__PAGEEX__\} \S2{} $\{__PAGEEX__\}
Defined in \R{pageex}{PageEx} scope. Defined as the page type in \R{pageex}{PageEx} scope.
\c !ifdef __PAGEEX__ \c !ifdef __PAGEEX__
\c !error "this shouldn't be here!" \c !error "this shouldn't be here!"
@ -287,6 +287,10 @@ Defined in \R{pageex}{PageEx} scope.
\c !ifndef __PAGEEX__ \c !ifndef __PAGEEX__
\c !error "missing predefine!" \c !error "missing predefine!"
\c !endif \c !endif
\c
\c !if ${__PAGEEX__} != instfiles
\c !error "wrong page type"
\c !endif
\c \c
\c PageExEnd \c PageExEnd

View file

@ -202,10 +202,16 @@ FunctionEnd
PageEx instfiles PageEx instfiles
!insertmacro TEST_SCOPES "pageex" n n n y n !insertmacro TEST_SCOPES "pageex" n n n y n
!if ${__PAGEEX__} != instfiles
!error "invalid __PAGEEX__ value"
!endif
PageExEnd PageExEnd
PageEx un.instfiles PageEx un.instfiles
!insertmacro TEST_SCOPES "uninstall pageex" n n n y y !insertmacro TEST_SCOPES "uninstall pageex" n n n y y
!if ${__PAGEEX__} != instfiles
!error "invalid __PAGEEX__ value"
!endif
PageExEnd PageExEnd
!insertmacro TEST_SCOPES "global" y n n n n !insertmacro TEST_SCOPES "global" y n n n n

View file

@ -1544,26 +1544,27 @@ int CEXEBuild::add_page(int type)
struct { struct {
int wndproc_id; int wndproc_id;
int dlg_id; int dlg_id;
char *name;
} ids[] = { } ids[] = {
{PWP_CUSTOM, 0}, // custom {PWP_CUSTOM, 0, "custom"}, // custom
#ifdef NSIS_CONFIG_LICENSEPAGE #ifdef NSIS_CONFIG_LICENSEPAGE
{PWP_LICENSE, IDD_LICENSE}, // license {PWP_LICENSE, IDD_LICENSE, "license"}, // license
#else #else
{0, IDD_LICENSE}, // license {0, IDD_LICENSE, "license"}, // license
#endif #endif
#ifdef NSIS_CONFIG_COMPONENTPAGE #ifdef NSIS_CONFIG_COMPONENTPAGE
{PWP_SELCOM, IDD_SELCOM}, // components {PWP_SELCOM, IDD_SELCOM, "components"}, // components
#else #else
{0, IDD_SELCOM}, // components {0, IDD_SELCOM, "components"}, // components
#endif #endif
{PWP_DIR, IDD_DIR}, // directory {PWP_DIR, IDD_DIR, "directory"}, // directory
{PWP_INSTFILES, IDD_INSTFILES}, // instfiles {PWP_INSTFILES, IDD_INSTFILES, "instfiles"}, // instfiles
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT #ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
{PWP_UNINST, IDD_UNINST}, // uninstConfirm {PWP_UNINST, IDD_UNINST, "uninstConfirm"}, // uninstConfirm
#else #else
{0, IDD_UNINST}, // uninstConfirm {0, IDD_UNINST, "uninstConfirm"}, // uninstConfirm
#endif #endif
{PWP_COMPLETED, -1} // completed {PWP_COMPLETED, -1, NULL} // completed
}; };
pg.wndproc_id = ids[type].wndproc_id; pg.wndproc_id = ids[type].wndproc_id;
@ -1575,7 +1576,7 @@ int CEXEBuild::add_page(int type)
cur_page_type = type; cur_page_type = type;
set_code_type_predefines(); set_code_type_predefines(ids[type].name);
return PS_OK; return PS_OK;
} }
@ -3448,7 +3449,7 @@ void CEXEBuild::set_code_type_predefines(const char *value)
definedlist.add("__FUNCTION__", value==NULL?"":value); definedlist.add("__FUNCTION__", value==NULL?"":value);
break; break;
case TP_PAGEEX: case TP_PAGEEX:
definedlist.add("__PAGEEX__"); definedlist.add("__PAGEEX__", value==NULL?"":value);
break; break;
default: default:
definedlist.add("__GLOBAL__"); definedlist.add("__GLOBAL__");