Skip to content

Commit

Permalink
all: Remove third argument to MP_REGISTER_MODULE.
Browse files Browse the repository at this point in the history
It's no longer needed because this macro is now processed after
preprocessing the source code via cpp (in the qstr extraction stage), which
means unused MP_REGISTER_MODULE's are filtered out by the preprocessor.

Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Jun 2, 2022
1 parent 47f6343 commit efe23ac
Show file tree
Hide file tree
Showing 103 changed files with 173 additions and 134 deletions.
12 changes: 7 additions & 5 deletions docs/develop/cmodules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,23 +221,25 @@ as described above.
If a module is not enabled by default then the corresponding C preprocessor macro
must be enabled. This macro name can be found by searching for the ``MP_REGISTER_MODULE``
line in the module's source code (it usually appears at the end of the main source file).
The third argument to ``MP_REGISTER_MODULE`` is the macro name, and this must be set
to 1 using ``CFLAGS_EXTRA`` to make the module available. If the third argument is just
the number 1 then the module is enabled by default.
This macro should be surrounded by a ``#if X`` / ``#endif`` pair, and the configuration
option ``X`` must be set to 1 using ``CFLAGS_EXTRA`` to make the module available. If
there is no ``#if X`` / ``#endif`` pair then the module is enabled by default.

For example, the ``examples/usercmodule/cexample`` module is enabled by default so
has the following line in its source code:

.. code-block:: c
MP_REGISTER_MODULE(MP_QSTR_cexample, example_user_cmodule, 1);
MP_REGISTER_MODULE(MP_QSTR_cexample, example_user_cmodule);
Alternatively, to make this module disabled by default but selectable through
a preprocessor configuration option, it would be:

.. code-block:: c
MP_REGISTER_MODULE(MP_QSTR_cexample, example_user_cmodule, MODULE_CEXAMPLE_ENABLED);
#if MODULE_CEXAMPLE_ENABLED
MP_REGISTER_MODULE(MP_QSTR_cexample, example_user_cmodule);
#endif
In this case the module is enabled by adding ``CFLAGS_EXTRA=-DMODULE_CEXAMPLE_ENABLED=1``
to the ``make`` command, or editing ``mpconfigport.h`` or ``mpconfigboard.h`` to add
Expand Down
2 changes: 1 addition & 1 deletion docs/develop/library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ hypothetical new module ``subsystem`` in the file ``modsubsystem.c``:
.globals = (mp_obj_dict_t *)&mp_module_subsystem_globals,
};
MP_REGISTER_MODULE(MP_QSTR_subsystem, mp_module_subsystem, MICROPY_PY_SUBSYSTEM);
MP_REGISTER_MODULE(MP_QSTR_subsystem, mp_module_subsystem);
#endif
Expand Down
7 changes: 1 addition & 6 deletions docs/develop/porting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,7 @@ To add a custom module like ``myport``, first add the module definition in a fil
.globals = (mp_obj_dict_t *)&myport_module_globals,
};
MP_REGISTER_MODULE(MP_QSTR_myport, myport_module, 1);
Note: the "1" as the third argument in ``MP_REGISTER_MODULE`` enables this new module
unconditionally. To allow it to be conditionally enabled, replace the "1" by
``MICROPY_PY_MYPORT`` and then add ``#define MICROPY_PY_MYPORT (1)`` in ``mpconfigport.h``
accordingly.
MP_REGISTER_MODULE(MP_QSTR_myport, myport_module);
You will also need to edit the Makefile to add ``modmyport.c`` to the ``SRC_C`` list, and
a new line adding the same file to ``SRC_QSTR`` (so qstrs are searched for in this new file),
Expand Down
5 changes: 1 addition & 4 deletions examples/usercmodule/cexample/examplemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,4 @@ const mp_obj_module_t example_user_cmodule = {
};

// Register the module to make it available in Python.
// Note: the "1" in the third argument means this module is always enabled.
// This "1" can be optionally replaced with a macro like MODULE_CEXAMPLE_ENABLED
// which can then be used to conditionally enable this module.
MP_REGISTER_MODULE(MP_QSTR_cexample, example_user_cmodule, 1);
MP_REGISTER_MODULE(MP_QSTR_cexample, example_user_cmodule);
5 changes: 1 addition & 4 deletions examples/usercmodule/cppexample/examplemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,4 @@ const mp_obj_module_t cppexample_user_cmodule = {
};

// Register the module to make it available in Python.
// Note: the "1" in the third argument means this module is always enabled.
// This "1" can be optionally replaced with a macro like MODULE_CPPEXAMPLE_ENABLED
// which can then be used to conditionally enable this module.
MP_REGISTER_MODULE(MP_QSTR_cppexample, cppexample_user_cmodule, 1);
MP_REGISTER_MODULE(MP_QSTR_cppexample, cppexample_user_cmodule);
2 changes: 1 addition & 1 deletion extmod/modbluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ const mp_obj_module_t mp_module_ubluetooth = {
.globals = (mp_obj_dict_t *)&mp_module_bluetooth_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ubluetooth, mp_module_ubluetooth, MICROPY_PY_BLUETOOTH);
MP_REGISTER_MODULE(MP_QSTR_ubluetooth, mp_module_ubluetooth);

// Helpers

Expand Down
2 changes: 1 addition & 1 deletion extmod/modbtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ const mp_obj_module_t mp_module_btree = {
.globals = (mp_obj_dict_t *)&mp_module_btree_globals,
};

MP_REGISTER_MODULE(MP_QSTR_btree, mp_module_btree, MICROPY_PY_BTREE);
MP_REGISTER_MODULE(MP_QSTR_btree, mp_module_btree);
#endif

#endif // MICROPY_PY_BTREE
2 changes: 1 addition & 1 deletion extmod/modframebuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ const mp_obj_module_t mp_module_framebuf = {
.globals = (mp_obj_dict_t *)&framebuf_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_framebuf, mp_module_framebuf, MICROPY_PY_FRAMEBUF);
MP_REGISTER_MODULE(MP_QSTR_framebuf, mp_module_framebuf);
#endif

#endif // MICROPY_PY_FRAMEBUF
4 changes: 2 additions & 2 deletions extmod/modlwip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1778,9 +1778,9 @@ const mp_obj_module_t mp_module_lwip = {
.globals = (mp_obj_dict_t *)&mp_module_lwip_globals,
};

MP_REGISTER_MODULE(MP_QSTR_lwip, mp_module_lwip, MICROPY_PY_LWIP);
MP_REGISTER_MODULE(MP_QSTR_lwip, mp_module_lwip);

// On LWIP-ports, this is the usocket module (replaces extmod/modusocket.c).
MP_REGISTER_MODULE(MP_QSTR_usocket, mp_module_lwip, MICROPY_PY_LWIP);
MP_REGISTER_MODULE(MP_QSTR_usocket, mp_module_lwip);

#endif // MICROPY_PY_LWIP
2 changes: 1 addition & 1 deletion extmod/modnetwork.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const mp_obj_module_t mp_module_network = {
.globals = (mp_obj_dict_t *)&mp_module_network_globals,
};

MP_REGISTER_MODULE(MP_QSTR_network, mp_module_network, MICROPY_PY_NETWORK);
MP_REGISTER_MODULE(MP_QSTR_network, mp_module_network);

/*******************************************************************************/
// Implementations of network methods that can be used by any interface
Expand Down
2 changes: 1 addition & 1 deletion extmod/modonewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,6 @@ const mp_obj_module_t mp_module_onewire = {
.globals = (mp_obj_dict_t *)&onewire_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR__onewire, mp_module_onewire, MICROPY_PY_ONEWIRE);
MP_REGISTER_MODULE(MP_QSTR__onewire, mp_module_onewire);

#endif // MICROPY_PY_ONEWIRE
2 changes: 1 addition & 1 deletion extmod/moduasyncio.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,6 @@ const mp_obj_module_t mp_module_uasyncio = {
.globals = (mp_obj_dict_t *)&mp_module_uasyncio_globals,
};

MP_REGISTER_MODULE(MP_QSTR__uasyncio, mp_module_uasyncio, MICROPY_PY_UASYNCIO);
MP_REGISTER_MODULE(MP_QSTR__uasyncio, mp_module_uasyncio);

#endif // MICROPY_PY_UASYNCIO
2 changes: 1 addition & 1 deletion extmod/modubinascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,6 @@ const mp_obj_module_t mp_module_ubinascii = {
.globals = (mp_obj_dict_t *)&mp_module_binascii_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ubinascii, mp_module_ubinascii, MICROPY_PY_UBINASCII);
MP_REGISTER_MODULE(MP_QSTR_ubinascii, mp_module_ubinascii);

#endif // MICROPY_PY_UBINASCII
2 changes: 1 addition & 1 deletion extmod/moducryptolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,6 @@ const mp_obj_module_t mp_module_ucryptolib = {
.globals = (mp_obj_dict_t *)&mp_module_ucryptolib_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ucryptolib, mp_module_ucryptolib, MICROPY_PY_UCRYPTOLIB);
MP_REGISTER_MODULE(MP_QSTR_ucryptolib, mp_module_ucryptolib);

#endif // MICROPY_PY_UCRYPTOLIB
2 changes: 1 addition & 1 deletion extmod/moductypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,6 @@ const mp_obj_module_t mp_module_uctypes = {
.globals = (mp_obj_dict_t *)&mp_module_uctypes_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uctypes, mp_module_uctypes, MICROPY_PY_UCTYPES);
MP_REGISTER_MODULE(MP_QSTR_uctypes, mp_module_uctypes);

#endif
2 changes: 1 addition & 1 deletion extmod/moduhashlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,6 @@ const mp_obj_module_t mp_module_uhashlib = {
.globals = (mp_obj_dict_t *)&mp_module_uhashlib_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uhashlib, mp_module_uhashlib, MICROPY_PY_UHASHLIB);
MP_REGISTER_MODULE(MP_QSTR_uhashlib, mp_module_uhashlib);

#endif // MICROPY_PY_UHASHLIB
2 changes: 1 addition & 1 deletion extmod/moduheapq.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const mp_obj_module_t mp_module_uheapq = {
.globals = (mp_obj_dict_t *)&mp_module_uheapq_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uheapq, mp_module_uheapq, MICROPY_PY_UHEAPQ);
MP_REGISTER_MODULE(MP_QSTR_uheapq, mp_module_uheapq);
#endif

#endif // MICROPY_PY_UHEAPQ
2 changes: 1 addition & 1 deletion extmod/modujson.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,6 @@ const mp_obj_module_t mp_module_ujson = {
.globals = (mp_obj_dict_t *)&mp_module_ujson_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ujson, mp_module_ujson, MICROPY_PY_UJSON);
MP_REGISTER_MODULE(MP_QSTR_ujson, mp_module_ujson);

#endif // MICROPY_PY_UJSON
2 changes: 1 addition & 1 deletion extmod/moduos.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,6 @@ const mp_obj_module_t mp_module_uos = {
.globals = (mp_obj_dict_t *)&os_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uos, mp_module_uos, MICROPY_PY_UOS);
MP_REGISTER_MODULE(MP_QSTR_uos, mp_module_uos);

#endif // MICROPY_PY_UOS
2 changes: 1 addition & 1 deletion extmod/moduplatform.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ const mp_obj_module_t mp_module_uplatform = {
.globals = (mp_obj_dict_t *)&modplatform_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uplatform, mp_module_uplatform, MICROPY_PY_UPLATFORM);
MP_REGISTER_MODULE(MP_QSTR_uplatform, mp_module_uplatform);

#endif // MICROPY_PY_UPLATFORM
2 changes: 1 addition & 1 deletion extmod/modurandom.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ const mp_obj_module_t mp_module_urandom = {
.globals = (mp_obj_dict_t *)&mp_module_urandom_globals,
};

MP_REGISTER_MODULE(MP_QSTR_urandom, mp_module_urandom, MICROPY_PY_URANDOM);
MP_REGISTER_MODULE(MP_QSTR_urandom, mp_module_urandom);
#endif

#endif // MICROPY_PY_URANDOM
2 changes: 1 addition & 1 deletion extmod/modure.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ const mp_obj_module_t mp_module_ure = {
.globals = (mp_obj_dict_t *)&mp_module_re_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ure, mp_module_ure, MICROPY_PY_URE);
MP_REGISTER_MODULE(MP_QSTR_ure, mp_module_ure);
#endif

// Source files #include'd here to make sure they're compiled in
Expand Down
2 changes: 1 addition & 1 deletion extmod/moduselect.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,6 @@ const mp_obj_module_t mp_module_uselect = {
.globals = (mp_obj_dict_t *)&mp_module_select_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uselect, mp_module_uselect, MICROPY_PY_USELECT);
MP_REGISTER_MODULE(MP_QSTR_uselect, mp_module_uselect);

#endif // MICROPY_PY_USELECT
2 changes: 1 addition & 1 deletion extmod/modusocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,6 @@ const mp_obj_module_t mp_module_usocket = {
.globals = (mp_obj_dict_t *)&mp_module_usocket_globals,
};

MP_REGISTER_MODULE(MP_QSTR_usocket, mp_module_usocket, MICROPY_PY_NETWORK && MICROPY_PY_USOCKET && !MICROPY_PY_LWIP);
MP_REGISTER_MODULE(MP_QSTR_usocket, mp_module_usocket);

#endif // MICROPY_PY_NETWORK && MICROPY_PY_USOCKET && !MICROPY_PY_LWIP
2 changes: 1 addition & 1 deletion extmod/modussl_axtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,6 @@ const mp_obj_module_t mp_module_ussl = {
.globals = (mp_obj_dict_t *)&mp_module_ssl_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ussl, mp_module_ussl, MICROPY_PY_USSL && MICROPY_SSL_AXTLS);
MP_REGISTER_MODULE(MP_QSTR_ussl, mp_module_ussl);

#endif // MICROPY_PY_USSL && MICROPY_SSL_AXTLS
2 changes: 1 addition & 1 deletion extmod/modussl_mbedtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,6 @@ const mp_obj_module_t mp_module_ussl = {
.globals = (mp_obj_dict_t *)&mp_module_ssl_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ussl, mp_module_ussl, MICROPY_PY_USSL && MICROPY_SSL_MBEDTLS);
MP_REGISTER_MODULE(MP_QSTR_ussl, mp_module_ussl);

#endif // MICROPY_PY_USSL && MICROPY_SSL_MBEDTLS
3 changes: 2 additions & 1 deletion extmod/modutimeq.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,6 @@ const mp_obj_module_t mp_module_utimeq = {
.globals = (mp_obj_dict_t *)&mp_module_utimeq_globals,
};

MP_REGISTER_MODULE(MP_QSTR_utimeq, mp_module_utimeq, MICROPY_PY_UTIMEQ);
MP_REGISTER_MODULE(MP_QSTR_utimeq, mp_module_utimeq);

#endif // MICROPY_PY_UTIMEQ
2 changes: 1 addition & 1 deletion extmod/moduwebsocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,6 @@ const mp_obj_module_t mp_module_uwebsocket = {
.globals = (mp_obj_dict_t *)&uwebsocket_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uwebsocket, mp_module_uwebsocket, MICROPY_PY_UWEBSOCKET);
MP_REGISTER_MODULE(MP_QSTR_uwebsocket, mp_module_uwebsocket);

#endif // MICROPY_PY_UWEBSOCKET
2 changes: 1 addition & 1 deletion extmod/moduzlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ const mp_obj_module_t mp_module_uzlib = {
};


MP_REGISTER_MODULE(MP_QSTR_uzlib, mp_module_uzlib, MICROPY_PY_UZLIB);
MP_REGISTER_MODULE(MP_QSTR_uzlib, mp_module_uzlib);
#endif

// Source files #include'd here to make sure they're compiled in
Expand Down
2 changes: 1 addition & 1 deletion extmod/modwebrepl.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,6 @@ const mp_obj_module_t mp_module_webrepl = {
.globals = (mp_obj_dict_t *)&webrepl_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR__webrepl, mp_module_webrepl, MICROPY_PY_WEBREPL);
MP_REGISTER_MODULE(MP_QSTR__webrepl, mp_module_webrepl);

#endif // MICROPY_PY_WEBREPL
2 changes: 1 addition & 1 deletion ports/cc3200/mods/modmachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,4 @@ const mp_obj_module_t mp_module_machine = {
.globals = (mp_obj_dict_t*)&machine_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_umachine, mp_module_machine, MICROPY_PY_MACHINE);
MP_REGISTER_MODULE(MP_QSTR_umachine, mp_module_machine);
2 changes: 1 addition & 1 deletion ports/cc3200/mods/modnetwork.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const mp_obj_module_t mp_module_network = {
.globals = (mp_obj_dict_t*)&mp_module_network_globals,
};

MP_REGISTER_MODULE(MP_QSTR_network, mp_module_network, 1);
MP_REGISTER_MODULE(MP_QSTR_network, mp_module_network);

#if (MICROPY_PORT_HAS_TELNET || MICROPY_PORT_HAS_FTP)
STATIC const mp_rom_map_elem_t network_server_locals_dict_table[] = {
Expand Down
2 changes: 1 addition & 1 deletion ports/cc3200/mods/moduos.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,4 @@ const mp_obj_module_t mp_module_uos = {
.globals = (mp_obj_dict_t*)&os_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uos, mp_module_uos, 1);
MP_REGISTER_MODULE(MP_QSTR_uos, mp_module_uos);
2 changes: 1 addition & 1 deletion ports/cc3200/mods/modusocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,4 +817,4 @@ const mp_obj_module_t mp_module_usocket = {
.globals = (mp_obj_dict_t*)&mp_module_usocket_globals,
};

MP_REGISTER_MODULE(MP_QSTR_usocket, mp_module_usocket, 1);
MP_REGISTER_MODULE(MP_QSTR_usocket, mp_module_usocket);
2 changes: 1 addition & 1 deletion ports/cc3200/mods/modussl.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ const mp_obj_module_t mp_module_ussl = {
.globals = (mp_obj_dict_t*)&mp_module_ussl_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ussl, mp_module_ussl, 1);
MP_REGISTER_MODULE(MP_QSTR_ussl, mp_module_ussl);
2 changes: 1 addition & 1 deletion ports/cc3200/mods/modutime.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ const mp_obj_module_t mp_module_utime = {
.globals = (mp_obj_dict_t*)&time_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_utime, mp_module_utime, 1);
MP_REGISTER_MODULE(MP_QSTR_utime, mp_module_utime);
2 changes: 1 addition & 1 deletion ports/cc3200/mods/modwipy.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ const mp_obj_module_t wipy_module = {
.globals = (mp_obj_dict_t*)&wipy_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_wipy, wipy_module, 1);
MP_REGISTER_MODULE(MP_QSTR_wipy, wipy_module);
2 changes: 1 addition & 1 deletion ports/esp32/modesp.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ const mp_obj_module_t esp_module = {
.globals = (mp_obj_dict_t *)&esp_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_esp, esp_module, 1);
MP_REGISTER_MODULE(MP_QSTR_esp, esp_module);
2 changes: 1 addition & 1 deletion ports/esp32/modesp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,4 @@ const mp_obj_module_t esp32_module = {
.globals = (mp_obj_dict_t *)&esp32_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_esp32, esp32_module, 1);
MP_REGISTER_MODULE(MP_QSTR_esp32, esp32_module);
2 changes: 1 addition & 1 deletion ports/esp32/modmachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,6 @@ const mp_obj_module_t mp_module_machine = {
.globals = (mp_obj_dict_t *)&machine_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_umachine, mp_module_machine, MICROPY_PY_MACHINE);
MP_REGISTER_MODULE(MP_QSTR_umachine, mp_module_machine);

#endif // MICROPY_PY_MACHINE
2 changes: 1 addition & 1 deletion ports/esp32/modnetwork.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,4 @@ const mp_obj_module_t mp_module_network = {

// Note: This port doesn't define MICROPY_PY_NETWORK so this will not conflict
// with the common implementation provided by extmod/modnetwork.c.
MP_REGISTER_MODULE(MP_QSTR_network, mp_module_network, 1);
MP_REGISTER_MODULE(MP_QSTR_network, mp_module_network);
2 changes: 1 addition & 1 deletion ports/esp32/modsocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,4 +871,4 @@ const mp_obj_module_t mp_module_usocket = {
// Note: This port doesn't define MICROPY_PY_USOCKET or MICROPY_PY_LWIP so
// this will not conflict with the common implementation provided by
// extmod/mod{lwip,usocket}.c.
MP_REGISTER_MODULE(MP_QSTR_usocket, mp_module_usocket, 1);
MP_REGISTER_MODULE(MP_QSTR_usocket, mp_module_usocket);
2 changes: 1 addition & 1 deletion ports/esp32/modutime.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ const mp_obj_module_t utime_module = {
.globals = (mp_obj_dict_t *)&time_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_utime, utime_module, 1);
MP_REGISTER_MODULE(MP_QSTR_utime, utime_module);
2 changes: 1 addition & 1 deletion ports/esp8266/modesp.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,4 +380,4 @@ const mp_obj_module_t esp_module = {
.globals = (mp_obj_dict_t *)&esp_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_esp, esp_module, 1);
MP_REGISTER_MODULE(MP_QSTR_esp, esp_module);
2 changes: 1 addition & 1 deletion ports/esp8266/modmachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,6 @@ const mp_obj_module_t mp_module_machine = {
.globals = (mp_obj_dict_t *)&machine_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_umachine, mp_module_machine, MICROPY_PY_MACHINE);
MP_REGISTER_MODULE(MP_QSTR_umachine, mp_module_machine);

#endif // MICROPY_PY_MACHINE
2 changes: 1 addition & 1 deletion ports/esp8266/modnetwork.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,4 +548,4 @@ const mp_obj_module_t network_module = {

// Note: This port doesn't define MICROPY_PY_NETWORK so this will not conflict
// with the common implementation provided by extmod/modnetwork.c.
MP_REGISTER_MODULE(MP_QSTR_network, network_module, 1);
MP_REGISTER_MODULE(MP_QSTR_network, network_module);
2 changes: 1 addition & 1 deletion ports/esp8266/modutime.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ const mp_obj_module_t utime_module = {
.globals = (mp_obj_dict_t *)&time_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_utime, utime_module, 1);
MP_REGISTER_MODULE(MP_QSTR_utime, utime_module);
2 changes: 1 addition & 1 deletion ports/javascript/modutime.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ const mp_obj_module_t mp_module_utime = {
.globals = (mp_obj_dict_t *)&time_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_utime, mp_module_utime, 1);
MP_REGISTER_MODULE(MP_QSTR_utime, mp_module_utime);
Loading

0 comments on commit efe23ac

Please sign in to comment.