LogIt++
Header-only, macro-first C++ logging library
Loading...
Searching...
No Matches
MdbxProcessId.hpp
Go to the documentation of this file.
1#pragma once
2#ifndef LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_DETAIL_MDBXPROCESSID_HPP_INCLUDED
3#define LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_DETAIL_MDBXPROCESSID_HPP_INCLUDED
4
7
8#include <cstdint>
9
10#if defined(_WIN32)
11#include <windows.h>
12#else
13#include <unistd.h>
14#endif
15
16namespace logit {
17namespace detail {
18
19inline uint64_t current_process_id() {
20#if defined(_WIN32)
21 return static_cast<uint64_t>(GetCurrentProcessId());
22#else
23 return static_cast<uint64_t>(getpid());
24#endif
25}
26
27} // namespace detail
28} // namespace logit
29
30#endif // LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_DETAIL_MDBXPROCESSID_HPP_INCLUDED
uint64_t current_process_id()
The primary namespace for the LogIt++ library.