This repository has been archived by the owner on Jun 24, 2022. It is now read-only.
forked from EddyPronk/gub
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from Jahrme/librestrict-macos
Enable compiling librestrict on macOS.
- Loading branch information
Showing
4 changed files
with
30 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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,20 @@ | ||
/** | ||
* alias.h | ||
* | ||
* Darwin does not support alias attributes. | ||
* This header defines a 'safe' (i.e., platform-agnostic) way to create aliases. | ||
*/ | ||
|
||
/* Create a safe alias for NAME accessible via ALIASNAME. */ | ||
#define safe_alias(name, aliasname) _safe_alias(name, aliasname) | ||
|
||
/* Darwin does not support alias attributes. */ | ||
#ifndef __APPLE__ | ||
#define _safe_alias(name, aliasname) \ | ||
extern __typeof (name) aliasname __attribute__ ((alias (#name))) | ||
#else | ||
#define _safe_alias(name, aliasname) \ | ||
__asm__(".globl _" #aliasname); \ | ||
__asm__(".set _" #aliasname ", _" #name); \ | ||
extern __typeof(name) aliasname | ||
#endif |
This file contains 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 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 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