-
Notifications
You must be signed in to change notification settings - Fork 470
config, os: add support for Musl libc #771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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__ */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ | |
#ifndef __OS_GENERIC_WIN_BASE__ | ||
#define __OS_GENERIC_WIN_BASE__ | ||
|
||
#include <os/generic_base.h> | ||
|
||
// 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this instead just be added to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was previously only needed for Windows, now it's needed for Musl-based Linux too. I moved it to a new |
||
#define __BEGIN_DECLS extern "C" { | ||
#define __END_DECLS } | ||
#else | ||
#define __BEGIN_DECLS | ||
#define __END_DECLS | ||
#endif | ||
|
||
#ifndef API_AVAILABLE | ||
#define API_AVAILABLE(...) | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the unix and windows base.h versions just import generic_base.h?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see that they already do that. So we shouldn't need this additional install step then? Either way, doesn't hurt I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this new header needs to be installed to be importable at the expected install location.