From 0925ff3350e0c10e96859b489de07dd45383c4f7 Mon Sep 17 00:00:00 2001 From: q66 Date: Fri, 12 May 2017 00:05:18 +0200 Subject: [PATCH] clean up platform checks --- ostd/context_stack.hh | 4 ---- ostd/process.hh | 5 ----- ostd/stream.hh | 12 +++++------- src/context_stack.cc | 6 ++---- src/process.cc | 6 ++---- 5 files changed, 9 insertions(+), 24 deletions(-) diff --git a/ostd/context_stack.hh b/ostd/context_stack.hh index 859223b..a6101eb 100644 --- a/ostd/context_stack.hh +++ b/ostd/context_stack.hh @@ -24,10 +24,6 @@ #include "ostd/platform.hh" -#if !defined(OSTD_PLATFORM_POSIX) && !defined(OSTD_PLATFORM_WIN32) -# error "Unsupported platform" -#endif - #ifdef OSTD_USE_VALGRIND # include #endif diff --git a/ostd/process.hh b/ostd/process.hh index cb7c820..1441c0a 100644 --- a/ostd/process.hh +++ b/ostd/process.hh @@ -21,11 +21,6 @@ #include #include "ostd/platform.hh" - -#if !defined(OSTD_PLATFORM_POSIX) && !defined(OSTD_PLATFORM_WIN32) -# error "Unsupported platform" -#endif - #include "ostd/string.hh" #include "ostd/range.hh" #include "ostd/io.hh" diff --git a/ostd/stream.hh b/ostd/stream.hh index 01e954b..d348e88 100644 --- a/ostd/stream.hh +++ b/ostd/stream.hh @@ -44,10 +44,6 @@ #include "ostd/platform.hh" -#if !defined(OSTD_PLATFORM_POSIX) && !defined(OSTD_PLATFORM_WIN32) -# error "Unsupported platform" -#endif - #ifndef OSTD_PLATFORM_WIN32 #include #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. * * 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 - * a signed 64-bit integer. + * a signed 64-bit integer. On other systems it's `long`. */ using stream_off_t = off_t; -#else +#elif defined(OSTD_PLATFORM_WIN32) using stream_off_t = __int64; +#else +using stream_off_t = long; #endif /** @brief Reference position for seeking. diff --git a/src/context_stack.cc b/src/context_stack.cc index 9cbb3e4..9570dd7 100644 --- a/src/context_stack.cc +++ b/src/context_stack.cc @@ -5,12 +5,10 @@ #include "ostd/platform.hh" -#ifdef OSTD_PLATFORM_WIN32 +#if defined(OSTD_PLATFORM_WIN32) # include "src/win32/context_stack.cc" -#else -#ifdef OSTD_PLATFORM_POSIX +#elif defined(OSTD_PLATFORM_POSIX) # include "src/posix/context_stack.cc" #else # error "Unsupported platform" #endif -#endif diff --git a/src/process.cc b/src/process.cc index d89701a..d3a7e55 100644 --- a/src/process.cc +++ b/src/process.cc @@ -5,12 +5,10 @@ #include "ostd/platform.hh" -#ifdef OSTD_PLATFORM_WIN32 +#if defined(OSTD_PLATFORM_WIN32) # include "src/win32/process.cc" -#else -#ifdef OSTD_PLATFORM_POSIX +#elif defined(OSTD_PLATFORM_POSIX) # include "src/posix/process.cc" #else # error "Unsupported platform" #endif -#endif