Fix namespace

This commit is contained in:
Hyunjin Song
2024-10-03 20:32:55 +09:00
parent 7ce62fe0cb
commit 7782954e6e
4 changed files with 11 additions and 6 deletions

View File

@@ -12,6 +12,9 @@
#pragma once
namespace lmms
{
/// Nifty counter, also known as "Schwarz Counter". Used for ensuring global
/// static object initialization and destruction order.
@@ -58,3 +61,5 @@ private:
thread_local static int s_count;
};
template <void C(), void D()> thread_local int NiftyCounterTL<C, D>::s_count = 0;
} // namespace lmms

View File

@@ -9,7 +9,7 @@
# include "mingw-std-threads/mutex"
#endif
namespace _cdslib
namespace lmms::_cdslib
{
void init();
void deinit();
@@ -18,6 +18,6 @@ namespace _cdslib
static NiftyCounter<init, deinit> _counter;
static thread_local NiftyCounterTL<_cdslib::thread_init, _cdslib::thread_deinit> _thread_counter;
}
} // namespace lmms:_cdslib
#define CDS_THREAD_GUARD() (void)_cdslib::_thread_counter;
#define CDS_THREAD_GUARD() (void)lmms::_cdslib::_thread_counter;

View File

@@ -4,7 +4,7 @@
#include <memory>
namespace _cdslib
namespace lmms::_cdslib
{
void init()
@@ -31,4 +31,4 @@ void thread_deinit()
}
}
}
} // namespace lmms::_cdslib

View File

@@ -55,7 +55,7 @@ if not Path('.gitmodules').is_file():
print('You need to call this script from the LMMS top directory')
exit(1)
result = subprocess.run(['git', 'ls-files', '*.[ch]', '*.[ch]pp', ':!tests/*'],
result = subprocess.run(['git', 'ls-files', '*.[ch]', '*.[ch]pp', ':!tests/*', ':!benchmarks/*'],
capture_output=True, text=True, check=True)
known_no_namespace_lmms = {