Skip to content

Commit ca40df0

Browse files
committed
os: create generic_base.h for _DECLS macros
1 parent 65626f8 commit ca40df0

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

os/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
# voucher_private.h are included in the source tarball
44

55
install(FILES
6-
object.h
6+
generic_base.h
77
generic_unix_base.h
88
generic_win_base.h
9+
object.h
910
DESTINATION
1011
"${INSTALL_OS_HEADERS_DIR}")
1112

os/generic_base.h

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2011-2014 Apple Inc. All rights reserved.
3+
*
4+
* @APPLE_APACHE_LICENSE_HEADER_START@
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
* @APPLE_APACHE_LICENSE_HEADER_END@
19+
*/
20+
21+
#ifndef __OS_GENERIC_BASE__
22+
#define __OS_GENERIC_BASE__
23+
24+
#if !defined(__BEGIN_DECLS) && !defined(__END_DECLS)
25+
#if defined(__cplusplus)
26+
#define __BEGIN_DECLS extern "C" {
27+
#define __END_DECLS }
28+
#else
29+
#define __BEGIN_DECLS
30+
#define __END_DECLS
31+
#endif
32+
#endif
33+
34+
#endif /* __OS_GENERIC_BASE__ */

os/generic_unix_base.h

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#ifndef __OS_GENERIC_UNIX_BASE__
1414
#define __OS_GENERIC_UNIX_BASE__
1515

16+
#include <os/generic_base.h>
17+
1618
#if __has_include(<sys/sysmacros.h>)
1719
#include <sys/sysmacros.h>
1820
#endif

os/generic_win_base.h

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#ifndef __OS_GENERIC_WIN_BASE__
1414
#define __OS_GENERIC_WIN_BASE__
1515

16+
#include <os/generic_base.h>
17+
1618
// Unices provide `roundup` via sys/param.h
1719
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
1820
// Unices provide `MAX` via sys/param.h

0 commit comments

Comments
 (0)