mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-17 16:17:02 +08:00
refactor: define WIN32_LEAN_AND_MEAN
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <psapi.h>
|
||||
#else
|
||||
@@ -15,12 +16,14 @@ inline size_t get_current_rss() {
|
||||
return pmc.WorkingSetSize;
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
#elif defined(__linux__)
|
||||
std::ifstream statm("/proc/self/statm");
|
||||
long vsz = 0, rss_pages = 0;
|
||||
statm >> vsz >> rss_pages;
|
||||
statm.close();
|
||||
long page_size = sysconf(_SC_PAGESIZE);
|
||||
return rss_pages * page_size;
|
||||
#else
|
||||
return 0; // Unsupported platform
|
||||
#endif
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <Cubed/tools/log.hpp>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
typedef LONG (WINAPI* RtlGetVersionPtr)(PRTL_OSVERSIONINFOW);
|
||||
inline bool get_os_version(std::string& str) {
|
||||
|
||||
Reference in New Issue
Block a user