PCB Environment: /home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/Defs.hpp Source File

PCB Environment 2

Loading...
Searching...
No Matches
Defs.hpp
1
2#ifndef GYM_PCB_DEFS_H
3#define GYM_PCB_DEFS_H
4
5#include <cstdint>
6
7#ifdef GYM_PCB_NO_STDFORMAT
8#include <fmt/format.h>
9#else
10#include <format>
11namespace fmt { using std::format; }
12#endif
13
14using Real = double;
15using uint = unsigned int;
16
17#define std_08x std::hex << std::setw(8) << std::setfill('0')
18
19#define PEDANTIC(args...) args
20
21#define WITH_LOCK(a, b) do { std::lock_guard _lock((a)->getLock()); b; } while(0)
22
23#define WITH_RLOCK(a, b) do { std::shared_lock _lock((a)->getLock()); b; } while(0)
24#define WITH_WLOCK(a, b) do { std::unique_lock _lock((a)->getLock()); b; } while(0)
25
26#endif // GYM_PCB_DEFS_H