зеркало из https://github.com/mozilla/gecko-dev.git
Bug 614631 - Macros for SEH exception depending on compiler configuration r+a=benjamin
This commit is contained in:
Родитель
8309907d43
Коммит
5eafd1843f
|
@ -683,6 +683,7 @@ case "$target" in
|
|||
_MOZ_RTTI_FLAGS_OFF='-GR-'
|
||||
_MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
|
||||
_MOZ_EXCEPTIONS_FLAGS_OFF=''
|
||||
AC_DEFINE(HAVE_SEH_EXCEPTIONS)
|
||||
|
||||
if test -n "$WIN32_REDIST_DIR"; then
|
||||
WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
|
||||
|
|
|
@ -69,11 +69,11 @@ PR_BEGIN_MACRO \
|
|||
ret = fun; \
|
||||
else \
|
||||
{ \
|
||||
try \
|
||||
MOZ_SEH_TRY \
|
||||
{ \
|
||||
ret = fun; \
|
||||
} \
|
||||
catch(...) \
|
||||
MOZ_SEH_EXCEPT(PR_TRUE) \
|
||||
{ \
|
||||
nsresult res; \
|
||||
nsCOMPtr<nsIPluginHost> host(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &res));\
|
||||
|
@ -92,11 +92,11 @@ PR_BEGIN_MACRO \
|
|||
fun; \
|
||||
else \
|
||||
{ \
|
||||
try \
|
||||
MOZ_SEH_TRY \
|
||||
{ \
|
||||
fun; \
|
||||
} \
|
||||
catch(...) \
|
||||
MOZ_SEH_EXCEPT(PR_TRUE) \
|
||||
{ \
|
||||
nsresult res; \
|
||||
nsCOMPtr<nsIPluginHost> host(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &res));\
|
||||
|
|
|
@ -236,7 +236,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
|
|||
}
|
||||
|
||||
#ifndef WINCE
|
||||
try {
|
||||
MOZ_SEH_TRY {
|
||||
#endif
|
||||
if (mMode == modeOpen) {
|
||||
// FILE MUST EXIST!
|
||||
|
@ -286,7 +286,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
|
|||
}
|
||||
#ifndef WINCE
|
||||
}
|
||||
catch(...) {
|
||||
MOZ_SEH_EXCEPT(PR_TRUE) {
|
||||
MessageBoxW(ofn.hwndOwner,
|
||||
0,
|
||||
L"The filepicker was unexpectedly closed by Windows.",
|
||||
|
@ -294,7 +294,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
|
|||
result = PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (result) {
|
||||
// Remember what filter type the user selected
|
||||
mSelectedType = (PRInt16)ofn.nFilterIndex;
|
||||
|
|
|
@ -555,4 +555,15 @@ typedef PRUint32 nsrefcnt;
|
|||
# define NS_OVERRIDE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* SEH exception macros.
|
||||
*/
|
||||
#ifdef HAVE_SEH_EXCEPTIONS
|
||||
#define MOZ_SEH_TRY __try
|
||||
#define MOZ_SEH_EXCEPT(expr) __except(expr)
|
||||
#else
|
||||
#define MOZ_SEH_TRY if(PR_TRUE)
|
||||
#define MOZ_SEH_EXCEPT(expr) else
|
||||
#endif
|
||||
|
||||
#endif /* nscore_h___ */
|
||||
|
|
Загрузка…
Ссылка в новой задаче