monero
monero copied to clipboard
Remove src/platform
All the files in src/platform
are currently unused and/or unnecessary:
-
mingw/alloca.h
: unused throughout project -
msc/sys/param.h
: Justifications by file below-
fix_darwin.patch
:sys/param.h
is well-defined to be included only in OpenBSD environment -
int-util.h
already handles whensys/param.h
is not present and injects its own values -
db_drivers/liblmdb/mdb.c
is a similar situation: already explicitly handles different platforms -
src/crypto/chacha.h
usesint-util.h
for endianness context
-
-
msc/alloca.h
: unused -
msc/inline_c.h
: unused and not needed. theinline
keyword is supported for C99 I believe, and certainly for C11, C14+ -
msc/stdbool.h
:stdbool.h
is standard since C99, and MSVC has supported it for a long time (~10 years)
There is a high likelihood that I missed some obscure backwards compatibility issue, and because of that I tried my best to do my due diligence, but I'm very open to the possibility that this commit may be too controversial.
Indeed, AFAI saw, all you said holds.
I am just a bit worried because three files include stdbool.h
and maybe removing it from msc/stdbool.h
may cause problems. However, as you said, MSVC has supported it for some time and msc/stdbool.h
was added to Monero before 2015, so maybe removing it should be fine, unless there are people running old systems? I am not used to Windows though.
Moreover, there are other files in external/miniupnp/miniupnp/
that include sys/param.h
that should be looked at,
I am not approving because I don't have a Windows system to test if things are working correctly, although compilation works (since the checks passed). I also don't know about any backwards compatibility.
Also, after those removals, are there any unused #include
s that could be removed?
Moreover, there are other files in external/miniupnp/miniupnp/ that include sys/param.h that should be looked at
Do you have any specific examples of things that may cause problems?
Also, after those removals, are there any unused #includes that could be removed?
I don't think so, most of it was unused anyways.
@tobtoht