Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions site/source/docs/tools_reference/settings_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 0 additions & 9 deletions test/core/test_core_types.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdalign.h>
#include <stdint.h>
#include <stddef.h>
Expand Down
2 changes: 0 additions & 2 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
11 changes: 0 additions & 11 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 0 additions & 5 deletions tools/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down