diff --git a/include/ircd/js/js.h b/include/ircd/js/js.h index 0c1dbbfd0..8fc678e10 100644 --- a/include/ircd/js/js.h +++ b/include/ircd/js/js.h @@ -33,6 +33,14 @@ #pragma once #define HAVE_IRCD_JS_JS_H +// SpiderMonkey makes use of the `DEBUG` define in headers which must match what the bottom +// end was also compiled with. We tie that define to RB_DEBUG controlled by --enable-debug. +// From a completely clean build, configuring IRCd with --enable-debug should compile SpiderMonkey +// in debug as well. +#ifdef RB_DEBUG + #define DEBUG +#endif + // SpiderMonkey headers require an include basis e.g. -I/usr/include/mozjs-XX as their // include directives are written as "jsxxx.h" or "mozilla/xxx.h" etc. Our includes are all // and shouldn't have any conflict issues. diff --git a/ircd/js.cc b/ircd/js.cc index fa41067b8..9f9f39d4c 100644 --- a/ircd/js.cc +++ b/ircd/js.cc @@ -137,6 +137,9 @@ js::ReportOutOfMemory(ExclusiveContext *const c) std::terminate(); } +// This was only ever defined for the SpiderMonkey headers and some of our hacks above. +#undef DEBUG + /////////////////////////////////////////////////////////////////////////////// // // ircd/js/js.h - With 3rd party (JSAPI) symbols