diff --git a/website/guide/compiling.html b/website/guide/compiling.html index 5e78db97..18eb9946 100644 --- a/website/guide/compiling.html +++ b/website/guide/compiling.html @@ -186,6 +186,10 @@ The table below summarizes the available options, in no particular order:

features depending on it. +DUK_OPT_PANIC_HANDLER(code,msg) +Provide a custom panic handler, see detailed description below. + + DUK_OPT_SEGFAULT_ON_PANIC Cause the default panic handler to cause a segfault instead of using abort() or exit(). This is useful when debugging @@ -292,7 +296,7 @@ you can easily create inconsistent DUK_USE_xxx flags, the customization header will be version specific, and you need to peek into Duktape internals to know what defines to tweak.

-

DUK_PANIC_HANDLER

+

DUK_OPT_PANIC_HANDLER

The default panic handler will print an error message to stdout unless I/O is disabled by DUK_OPT_NO_FILE_IO. It will then call @@ -300,15 +304,15 @@ unless I/O is disabled by DUK_OPT_NO_FILE_IO. It will then call DUK_OPT_SEGFAULT_ON_PANIC is defined.

You can override the entire panic handler by defining -DUK_PANIC_HANDLER. For example, you could add the +DUK_OPT_PANIC_HANDLER. For example, you could add the following to your compiler options:

-'-DDUK_PANIC_HANDLER(code,msg)={printf("*** %d:%s\n",(code),(msg));abort();}'
+'-DDUK_OPT_PANIC_HANDLER(code,msg)={printf("*** %d:%s\n",(code),(msg));abort();}'
 

Or perhaps:

-'-DDUK_PANIC_HANDLER(code,msg)={my_panic_handler((code),(msg))}'
+'-DDUK_OPT_PANIC_HANDLER(code,msg)={my_panic_handler((code),(msg))}'
 

which calls your custom handler: