-
Notifications
You must be signed in to change notification settings - Fork 19
Port openmcx to macOS #18
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
Open
robincaloudis
wants to merge
9
commits into
eclipse-openmcx:main
Choose a base branch
from
robincaloudis:rc-apple
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cc4a483
Make dlopen cross platform
robincaloudis 255b04c
Provide portable impl of pthread_timedjoin_np
robincaloudis 46f64ed
Do not use Linux specific link options on Mac OS
robincaloudis c0a000f
Provide platform independent fmu's
robincaloudis 11a55fc
Make `mcx_sort()` portable
robincaloudis 339f1f8
Include necessary headers for Apple platform
robincaloudis 2fb3e24
Guard headers that are only used on Apple machines
robincaloudis dcfc116
Add comment about differences in qsort_r
robincaloudis 7edbe23
Bracket the code properly
robincaloudis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /******************************************************************************** | ||
| * Copyright (c) 2020 AVL List GmbH and others | ||
| * | ||
| * This program and the accompanying materials are made available under the | ||
| * terms of the Apache Software License 2.0 which is available at | ||
| * https://www.apache.org/licenses/LICENSE-2.0. | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| ********************************************************************************/ | ||
|
|
||
| #include "CentralParts.h" | ||
|
|
||
| #include "util/stdlib.h" | ||
|
|
||
| #include <stdlib.h> | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif /* __cplusplus */ | ||
|
|
||
|
|
||
| #if (__APPLE__) | ||
| void mcx_sort(void *base, size_t nmemb, size_t size, | ||
| int (*compar)(void *, const void *, const void *), void *arg) { | ||
| // FreeBSD added qsort_r in Sept 2002, but with a poor interface. In | ||
| // 2008 GNU fixed the interface and decided the compatibility breakage | ||
| // was worth it following ISO. Linux is GNU. OS X is a mish-mash of many | ||
| // things, but for C it follows BSD. As a result, we have difference in | ||
| // the non-standard qsort_r function. | ||
| // See https://stackoverflow.com/a/39561369 for details. | ||
| qsort_r(base, nmemb, size, arg, compar); | ||
| } | ||
| #else | ||
| void mcx_sort(void *base, size_t nmemb, size_t size, | ||
| int (*compar)(const void *, const void *, void *), void *arg) { | ||
| qsort_r(base, nmemb, size, compar, arg); | ||
| } | ||
| #endif | ||
|
|
||
|
|
||
| #ifdef __cplusplus | ||
| } /* closing brace for extern "C" */ | ||
| #endif /* __cplusplus */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Strange that the arg argument comes first in the apple implementation. We should add a comment to the source code to point this out.
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.
Added a comment 👍