| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On platforms where g_once_init_enter() is defined to use C11 atomic
builtins, passing a pointer to a volatile value is an error in GCC 11 and
later, in C++.
More info about the GCC change:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95378
https://gcc.gnu.org/pipermail/gcc-patches/2020-June/548283.html
However, it's my understanding that in modern C++ there is no longer a
need to guard the initialization of these variables. Since C++11, static
local variables in a function are guaranteed to be initialized only once,
the first time control passes through that function. So we can just remove
the g_once_init_enter guard.
More info:
https://en.cppreference.com/w/cpp/language/storage_duration#Static_local_variables
Stack Overflow answers with quotations from the C++ standard:
https://stackoverflow.com/a/58804/172999
https://stackoverflow.com/a/8102145/172999
Closes: #376
|
|
|
|
|
|
|
|
| |
The SPDX format is machine-readable, which should make it much easier to
avoid mistakes with licensing and copyright using automated tools.
This commit does not add any implicit information. It converts exactly
what was already specified into SPDX format comments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously #include statements were a bit of a mess across the codebase.
This commit is the result of a pass by the IWYU (Include What You Use)
tool, which suggests headers to add or remove based on what is in the
file, and can also suggest forward-declaring classes instead of
including their headers, if they are only used as a pointer in a
particular file. Cleaning this up should in general speed up compile
times.
IWYU isn't perfect, it produces a number of false positives, so we don't
try to automate this process and we don't accept all of its
recommendations. We do add a script and configuration file to the tools/
directory so that IWYU can be every so often in the future.
We also clean up all the includes according to a consistent style, which
is now described clearly in the C++ style guide.
|
|
This is not really a utility file, it's part of the GJS public API, so
it should go in gjs/ and its header file should be installed in the
normal $pkgincludedir/gjs location; #include <util/error.h> isn't
namespaced and might be provided by any number of libraries.
|