Mercurial > minori
comparison dep/animia/src/main.cpp @ 62:4c6dd5999b39
*: update
1. updated animia
2. use widestrings for filesystem on Windows
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 01 Oct 2023 06:16:06 -0400 |
parents | 6ff7aabeb9d7 |
children | 18979b066284 |
comparison
equal
deleted
inserted
replaced
61:327568ad9be9 | 62:4c6dd5999b39 |
---|---|
1 #include "bsd.h" | 1 #include "bsd.h" |
2 #include "linux.h" | 2 #include "linux.h" |
3 #include "win32.h" | 3 #include "win32.h" |
4 #include <vector> | |
5 #include <string> | 4 #include <string> |
6 #include <unordered_map> | 5 #include <unordered_map> |
6 #include <vector> | |
7 #ifdef __linux__ | 7 #ifdef __linux__ |
8 # define ON_LINUX | 8 # define ON_LINUX |
9 #elif (defined(unix) || defined(__unix__) || defined(__unix) || \ | 9 #elif (defined(unix) || defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) |
10 (defined(__APPLE__) && defined(__MACH__))) | |
11 # define ON_UNIX | 10 # define ON_UNIX |
12 #elif defined(_WIN32) | 11 #elif defined(_WIN32) |
13 # define ON_WINDOWS | 12 # define ON_WINDOWS |
14 #endif | 13 #endif |
15 | 14 |
49 #else | 48 #else |
50 return {}; | 49 return {}; |
51 #endif | 50 #endif |
52 } | 51 } |
53 | 52 |
53 std::vector<std::string> filter_system_files(const std::vector<std::string>& source) { | |
54 #ifdef ON_WINDOWS | |
55 return Windows::filter_system_files(source); | |
56 #else | |
57 return source; | |
58 #endif | |
59 } | |
60 | |
54 std::unordered_map<int, std::vector<std::string>> get_all_open_files() { | 61 std::unordered_map<int, std::vector<std::string>> get_all_open_files() { |
55 #ifdef ON_UNIX | 62 #ifdef ON_UNIX |
56 return Unix::get_all_open_files(); | 63 return Unix::get_all_open_files(); |
57 #elif defined(ON_LINUX) | 64 #elif defined(ON_LINUX) |
58 return Linux::get_all_open_files(); | 65 return Linux::get_all_open_files(); |
61 #else | 68 #else |
62 return {}; | 69 return {}; |
63 #endif | 70 #endif |
64 } | 71 } |
65 | 72 |
66 } | 73 } // namespace Animia |