forked from OctaForge/libostd
clean up platform checks
parent
005485f6a6
commit
0925ff3350
|
@ -24,10 +24,6 @@
|
||||||
|
|
||||||
#include "ostd/platform.hh"
|
#include "ostd/platform.hh"
|
||||||
|
|
||||||
#if !defined(OSTD_PLATFORM_POSIX) && !defined(OSTD_PLATFORM_WIN32)
|
|
||||||
# error "Unsupported platform"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef OSTD_USE_VALGRIND
|
#ifdef OSTD_USE_VALGRIND
|
||||||
# include <valgrind/valgrind.h>
|
# include <valgrind/valgrind.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -21,11 +21,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "ostd/platform.hh"
|
#include "ostd/platform.hh"
|
||||||
|
|
||||||
#if !defined(OSTD_PLATFORM_POSIX) && !defined(OSTD_PLATFORM_WIN32)
|
|
||||||
# error "Unsupported platform"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "ostd/string.hh"
|
#include "ostd/string.hh"
|
||||||
#include "ostd/range.hh"
|
#include "ostd/range.hh"
|
||||||
#include "ostd/io.hh"
|
#include "ostd/io.hh"
|
||||||
|
|
|
@ -44,10 +44,6 @@
|
||||||
|
|
||||||
#include "ostd/platform.hh"
|
#include "ostd/platform.hh"
|
||||||
|
|
||||||
#if !defined(OSTD_PLATFORM_POSIX) && !defined(OSTD_PLATFORM_WIN32)
|
|
||||||
# error "Unsupported platform"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef OSTD_PLATFORM_WIN32
|
#ifndef OSTD_PLATFORM_WIN32
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -62,16 +58,18 @@ namespace ostd {
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef OSTD_PLATFORM_WIN32
|
#if defined(OSTD_PLATFORM_POSIX) || defined(OSTD_GENERATING_DOC)
|
||||||
/** @brief The stream offset type.
|
/** @brief The stream offset type.
|
||||||
*
|
*
|
||||||
* This is a signed integer type that can represent file sizes and offsets.
|
* This is a signed integer type that can represent file sizes and offsets.
|
||||||
* On POSIX systems, it defaults to the POSIX `off_t` type. On Windows, it's
|
* On POSIX systems, it defaults to the POSIX `off_t` type. On Windows, it's
|
||||||
* a signed 64-bit integer.
|
* a signed 64-bit integer. On other systems it's `long`.
|
||||||
*/
|
*/
|
||||||
using stream_off_t = off_t;
|
using stream_off_t = off_t;
|
||||||
#else
|
#elif defined(OSTD_PLATFORM_WIN32)
|
||||||
using stream_off_t = __int64;
|
using stream_off_t = __int64;
|
||||||
|
#else
|
||||||
|
using stream_off_t = long;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** @brief Reference position for seeking.
|
/** @brief Reference position for seeking.
|
||||||
|
|
|
@ -5,12 +5,10 @@
|
||||||
|
|
||||||
#include "ostd/platform.hh"
|
#include "ostd/platform.hh"
|
||||||
|
|
||||||
#ifdef OSTD_PLATFORM_WIN32
|
#if defined(OSTD_PLATFORM_WIN32)
|
||||||
# include "src/win32/context_stack.cc"
|
# include "src/win32/context_stack.cc"
|
||||||
#else
|
#elif defined(OSTD_PLATFORM_POSIX)
|
||||||
#ifdef OSTD_PLATFORM_POSIX
|
|
||||||
# include "src/posix/context_stack.cc"
|
# include "src/posix/context_stack.cc"
|
||||||
#else
|
#else
|
||||||
# error "Unsupported platform"
|
# error "Unsupported platform"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
|
@ -5,12 +5,10 @@
|
||||||
|
|
||||||
#include "ostd/platform.hh"
|
#include "ostd/platform.hh"
|
||||||
|
|
||||||
#ifdef OSTD_PLATFORM_WIN32
|
#if defined(OSTD_PLATFORM_WIN32)
|
||||||
# include "src/win32/process.cc"
|
# include "src/win32/process.cc"
|
||||||
#else
|
#elif defined(OSTD_PLATFORM_POSIX)
|
||||||
#ifdef OSTD_PLATFORM_POSIX
|
|
||||||
# include "src/posix/process.cc"
|
# include "src/posix/process.cc"
|
||||||
#else
|
#else
|
||||||
# error "Unsupported platform"
|
# error "Unsupported platform"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
Loading…
Reference in New Issue