/
srv
/
osrm
/
osrm-backend
/
third_party
/
libosmium
/
test
/
include
/
/srv/osrm/osrm-backend/third_party/libosmium/test/include
mkdir
upload
Name
Size
Mode
Actions
test_crc.hpp
363
0644
edit
dl
rm
utils.hpp
805
0644
edit
dl
rm
win_mkstemp.hpp
1092
0644
edit
dl
rm
Edit:
/srv/osrm/osrm-backend/third_party/libosmium/test/include/utils.hpp
(805B)
#include <cstdlib> #include <string> #ifndef _WIN32 # include <unistd.h> # include <fcntl.h> // This function counts the number of open file descriptors. It is used in // some tests to make sure that we are not leaking file descriptors. inline int count_fds() noexcept { int count = 0; for (int fd = 0; fd < 100; ++fd) { if (fcntl(fd, F_GETFD) == 0) { ++count; } } return count; } #else // Dummy for Windows which doesn't have fcntl inline int count_fds() noexcept { return 0; } #endif inline std::string with_data_dir(const char* filename) { const char* data_dir = getenv("OSMIUM_TEST_DATA_DIR"); std::string result; if (data_dir) { result = data_dir; result += '/'; } result += filename; return result; }
Save
cmd:
run