diff --git a/dispatch/source.h b/dispatch/source.h index b54862ea8..fa960d3c2 100644 --- a/dispatch/source.h +++ b/dispatch/source.h @@ -32,7 +32,7 @@ #endif #if !defined(_WIN32) -#include +#include #endif DISPATCH_ASSUME_NONNULL_BEGIN diff --git a/os/CMakeLists.txt b/os/CMakeLists.txt index 282af25f7..cccf97ba6 100644 --- a/os/CMakeLists.txt +++ b/os/CMakeLists.txt @@ -3,9 +3,10 @@ # voucher_private.h are included in the source tarball install(FILES - object.h + generic_base.h generic_unix_base.h generic_win_base.h + object.h DESTINATION "${INSTALL_OS_HEADERS_DIR}") diff --git a/os/generic_base.h b/os/generic_base.h new file mode 100644 index 000000000..e85257843 --- /dev/null +++ b/os/generic_base.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2011-2014 Apple Inc. All rights reserved. + * + * @APPLE_APACHE_LICENSE_HEADER_START@ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @APPLE_APACHE_LICENSE_HEADER_END@ + */ + +#ifndef __OS_GENERIC_BASE__ +#define __OS_GENERIC_BASE__ + +#if !defined(__BEGIN_DECLS) && !defined(__END_DECLS) +#if defined(__cplusplus) +#define __BEGIN_DECLS extern "C" { +#define __END_DECLS } +#else +#define __BEGIN_DECLS +#define __END_DECLS +#endif +#endif + +#endif /* __OS_GENERIC_BASE__ */ diff --git a/os/generic_unix_base.h b/os/generic_unix_base.h index aaf6f8504..b77d2adaa 100644 --- a/os/generic_unix_base.h +++ b/os/generic_unix_base.h @@ -13,6 +13,8 @@ #ifndef __OS_GENERIC_UNIX_BASE__ #define __OS_GENERIC_UNIX_BASE__ +#include + #if __has_include() #include #endif diff --git a/os/generic_win_base.h b/os/generic_win_base.h index afc5f4265..af2c602ec 100644 --- a/os/generic_win_base.h +++ b/os/generic_win_base.h @@ -13,6 +13,8 @@ #ifndef __OS_GENERIC_WIN_BASE__ #define __OS_GENERIC_WIN_BASE__ +#include + // Unices provide `roundup` via sys/param.h #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) // Unices provide `MAX` via sys/param.h @@ -25,14 +27,6 @@ typedef int mode_t; typedef void pthread_attr_t; -#if defined(__cplusplus) -#define __BEGIN_DECLS extern "C" { -#define __END_DECLS } -#else -#define __BEGIN_DECLS -#define __END_DECLS -#endif - #ifndef API_AVAILABLE #define API_AVAILABLE(...) #endif