v1
Laptop Windows 2024-02-21 20:24:00 -05:00
parent 2b4b7bcdf9
commit 43cf8c0ba1
8 changed files with 33 additions and 8 deletions

View File

@ -88,7 +88,9 @@ add_library(${BLT_TARGET} ${STD_FILES} ${PROFILING_FILES} ${FS_FILES} ${PARSE_FI
if(${ZLIB_FOUND}) if(${ZLIB_FOUND})
target_link_libraries(${BLT_TARGET} PUBLIC ZLIB::ZLIB) target_link_libraries(${BLT_TARGET} PUBLIC ZLIB::ZLIB)
endif() endif()
if (!MSVC)
target_link_libraries(${BLT_TARGET} PUBLIC stdc++fs) target_link_libraries(${BLT_TARGET} PUBLIC stdc++fs)
endif()
target_include_directories(${BLT_TARGET} PUBLIC include/) target_include_directories(${BLT_TARGET} PUBLIC include/)
target_include_directories(${BLT_TARGET} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/config/) target_include_directories(${BLT_TARGET} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/config/)

View File

@ -31,8 +31,10 @@ namespace blt
return ((seed * (seed * seed * 15731 + 789221) + 1376312589) & 0x7fffffff); return ((seed * (seed * seed * 15731 + 789221) + 1376312589) & 0x7fffffff);
} }
#ifdef __GCC__
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing" #pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
/** /**
* fast inverse sqrt * fast inverse sqrt
@ -51,8 +53,10 @@ namespace blt
return y; return y;
} }
#ifdef __GCC
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif
static inline constexpr double pow(int b, int p) static inline constexpr double pow(int b, int p)
{ {

View File

@ -27,11 +27,19 @@
#if defined(__clang__) || defined(__llvm__) || defined(__GNUC__) || defined(__GNUG__) #if defined(__clang__) || defined(__llvm__) || defined(__GNUC__) || defined(__GNUG__)
#include <byteswap.h> #if defined(__GNUC__) || defined(__GNUG__)
#include <byteswap.h>
#define SWAP16(val) bswap_16(val)
#define SWAP32(val) bswap_32(val)
#define SWAP64(val) bswap_64(val)
#else
#define SWAP16(val) __builtin_bswap16(val)
#define SWAP32(val) __builtin_bswap32(val)
#define SWAP64(val) __builtin_bswap64(val)
#endif
#define SWAP16(val) bswap_16(val)
#define SWAP32(val) bswap_32(val)
#define SWAP64(val) bswap_64(val)
#if __cplusplus >= 202002L #if __cplusplus >= 202002L
#include <bit> #include <bit>

View File

@ -144,6 +144,10 @@ namespace blt::system
// number of dirty pages (0) // number of dirty pages (0)
std::uint64_t dt; std::uint64_t dt;
}; };
#ifdef _MSC_VER
using suseconds_t = std::size_t;
#endif
struct timeval { struct timeval {
time_t tv_sec; /* Seconds */ time_t tv_sec; /* Seconds */

View File

@ -20,6 +20,7 @@
#define BLT_TYPES_H #define BLT_TYPES_H
#include <cstdint> #include <cstdint>
#include <cstddef>
#ifndef NO_BLT_NAMESPACE_ON_TYPES #ifndef NO_BLT_NAMESPACE_ON_TYPES
namespace blt namespace blt

View File

@ -22,6 +22,7 @@
#include <iterator> #include <iterator>
#include <blt/std/memory_util.h> #include <blt/std/memory_util.h>
#include "ranges.h" #include "ranges.h"
#include <stdexcept>
namespace blt namespace blt
{ {

@ -1 +1 @@
Subproject commit 401552da80b0971f818e648621260720ad40934e Subproject commit 67c24619e4f5ab2097b74cc397732c17a25d6944

View File

@ -6,10 +6,15 @@
#include <blt/std/system.h> #include <blt/std/system.h>
#include <blt/std/logging.h> #include <blt/std/logging.h>
#ifndef _MSC_VER
#include <sys/time.h> /* for struct timeval */ #include <sys/time.h> /* for struct timeval */
#include <climits> /* for CLK_TCK */
#include <sys/resource.h> #include <sys/resource.h>
#else
#include <windows.h>
#define RUSAGE_SELF 1
#endif
#include <climits> /* for CLK_TCK */
#include <cstring> #include <cstring>
#ifndef WIN32 #ifndef WIN32