mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-10 22:34:20 +00:00
Signed-off-by: Viktor Govako <viktor.govako@gmail.com> (cherry picked from commit 6a2f2662b334345dc8789e970f358cec3ed69c85)
29 lines
748 B
C++
29 lines
748 B
C++
#pragma once
|
|
|
|
#include "3party/opening_hours/opening_hours.hpp"
|
|
|
|
#if defined(OMIM_OS_MAC) || defined(OMIM_OS_LINUX)
|
|
#include <sys/resource.h>
|
|
#endif
|
|
|
|
#include <cstdint>
|
|
|
|
namespace platform::tests_support
|
|
{
|
|
inline void ChangeMaxNumberOfOpenFiles(size_t n)
|
|
{
|
|
#if defined(OMIM_OS_MAC) || defined(OMIM_OS_LINUX)
|
|
struct rlimit rlp;
|
|
getrlimit(RLIMIT_NOFILE, &rlp);
|
|
rlp.rlim_cur = n;
|
|
setrlimit(RLIMIT_NOFILE, &rlp);
|
|
#endif
|
|
}
|
|
|
|
using Month = osmoh::MonthDay::Month;
|
|
using Weekday = osmoh::Weekday;
|
|
|
|
time_t GetUnixtimeByDate(uint16_t year, Month month, uint8_t monthDay, uint8_t hours, uint8_t minutes);
|
|
time_t GetUnixtimeByWeekday(uint16_t year, Month month, Weekday weekday, uint8_t hours, uint8_t minutes);
|
|
} // namespace platform::tests_support
|