diff --git a/ChangeLog.md b/ChangeLog.md index fd7f53ca469a9..00244aac775fb 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -20,6 +20,8 @@ See docs/process.md for more on how version tagging works. 5.0.3 (in development) ---------------------- +- The deprecated `EMSCRIPTEN` macro is now defined in emscripten.h rather than + on the command line. (#26417) - Warn on usage of the deprecated `EMSCRIPTEN` macro (`__EMSCRIPTEN__` should be used instead). (#26381) - The `-sRELOCATABLE` setting was effectively removed (moved to legacy diff --git a/site/source/docs/tools_reference/settings_reference.rst b/site/source/docs/tools_reference/settings_reference.rst index 89f79600b845c..1e103ea8a4d4d 100644 --- a/site/source/docs/tools_reference/settings_reference.rst +++ b/site/source/docs/tools_reference/settings_reference.rst @@ -1701,8 +1701,6 @@ Set the environment variable EMCC_STRICT=1 or pass -sSTRICT to test that a codebase builds nicely in forward compatible manner. Changes enabled by this: - - The C define EMSCRIPTEN is not defined (__EMSCRIPTEN__ always is, and - is the correct thing to use). - STRICT_JS is enabled. - IGNORE_MISSING_MAIN is disabled. - AUTO_JS_LIBRARIES is disabled. diff --git a/src/settings.js b/src/settings.js index e7148433a5f94..87f779c846023 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1160,8 +1160,6 @@ var LINKABLE = false; // codebase builds nicely in forward compatible manner. // Changes enabled by this: // -// - The C define EMSCRIPTEN is not defined (__EMSCRIPTEN__ always is, and -// is the correct thing to use). // - STRICT_JS is enabled. // - IGNORE_MISSING_MAIN is disabled. // - AUTO_JS_LIBRARIES is disabled. diff --git a/test/core/test_core_types.c b/test/core/test_core_types.c index 1dd736e5b4d51..ab471fe6f63a7 100644 --- a/test/core/test_core_types.c +++ b/test/core/test_core_types.c @@ -75,15 +75,6 @@ #error __BIG_ENDIAN__ is defined #endif -// We prefer to use __EMSCRIPTEN__, but for compatibility, we define -// EMSCRIPTEN too. -#if defined(IN_STRICT_MODE) && defined(EMSCRIPTEN) -#error When compiling in -sSTRICT mode, EMSCRIPTEN should not be defined, but it was! -#endif -#if !defined(IN_STRICT_MODE) && !defined(EMSCRIPTEN) -#error EMSCRIPTEN is not defined -#endif - #include #include #include diff --git a/test/test_core.py b/test/test_core.py index a55bf02c9b970..14cfdfa21dda2 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -677,8 +677,6 @@ def test_sha1(self): self.do_runf('third_party/sha1.c', 'SHA1=15dd99a1991e0b3826fede3deffc1feba42278e6') def test_core_types(self): - if self.get_setting('STRICT'): - self.cflags += ['-DIN_STRICT_MODE=1'] self.do_runf('core/test_core_types.c') def test_cube2md5(self): diff --git a/test/test_other.py b/test/test_other.py index 7ba92eb07b506..99b4232b96c5a 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -11303,17 +11303,6 @@ def test_EMSCRIPTEN_macro(self): self.assert_fail([EMCC, '-Werror', 'src.c', '-c'], "'EMSCRIPTEN' has been marked as deprecated: use __EMSCRIPTEN__ instead") self.assert_fail([EMCC, '-sSTRICT', '-Werror', 'src.c', '-c'], "'EMSCRIPTEN' has been marked as deprecated: use __EMSCRIPTEN__ instead") - def test_EMSCRIPTEN_and_STRICT(self): - # __EMSCRIPTEN__ is the proper define; we support EMSCRIPTEN for legacy - # code, unless STRICT is enabled. - create_file('src.c', ''' - #ifndef EMSCRIPTEN - #error "not defined" - #endif - ''') - self.run_process([EMCC, 'src.c', '-c']) - self.expect_fail([EMCC, 'src.c', '-sSTRICT', '-c']) - def test_exception_settings(self): for catching, throwing, opts in itertools.product([0, 1], repeat=3): cmd = [EMXX, test_file('other/exceptions_modes_symbols_defined.cpp'), '-sDISABLE_EXCEPTION_THROWING=%d' % (1 - throwing), '-sDISABLE_EXCEPTION_CATCHING=%d' % (1 - catching), '-O%d' % opts] diff --git a/tools/compile.py b/tools/compile.py index ebff36258ab62..37fadfe61b3ac 100644 --- a/tools/compile.py +++ b/tools/compile.py @@ -96,11 +96,6 @@ def get_cflags(user_args): if settings.WASM_WORKERS: cflags.append('-D__EMSCRIPTEN_WASM_WORKERS__=1') - if not settings.STRICT: - # The preprocessor define EMSCRIPTEN is deprecated. Don't pass it to code - # in strict mode. Code should use the define __EMSCRIPTEN__ instead. - cflags.append('-DEMSCRIPTEN') - ports.add_cflags(cflags, settings) def array_contains_any_of(hay, needles):