author: kx <kx@radix-linux.su> 2024-12-20 16:11:07 +0300
committer: kx <kx@radix-linux.su> 2024-12-20 16:11:07 +0300
commit: 868b2b66b564b5c00e3a74d10be45db7151627ac
parent: cce2ae8d3312493b7653358bb4af201d3271377b
Commit Summary:
Diffstat:
1 file changed, 44 insertions, 0 deletions
diff --git a/mpu/mpu-symbols.h b/mpu/mpu-symbols.h
new file mode 100644
index 0000000..5dfa972
--- /dev/null
+++ b/mpu/mpu-symbols.h
@@ -0,0 +1,66 @@
+
+/***************************************************************
+ __MPU_SYMBOLS.H
+
+ This file contains declarations of interface for define
+ WEAK, ALIAS symbols in object files.
+
+ PART OF : MPU - library .
+
+ USAGE : Internal only .
+
+ NOTE : Include "libmpu.h" before this FILE .
+
+ Copyright (C) 2000 - 2024 by Andrew V.Kosteltsev.
+ All Rights Reserved.
+ ***************************************************************/
+
+#ifndef __MPU_SYMBOLS_H
+#define __MPU_SYMBOLS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifndef __ASSEMBLER__
+
+#define __mpu_strong_alias( name, symbol ) \
+ extern __typeof(name) symbol __attribute__ ((alias( #name )))
+
+#if defined( HAVE_WEAK_SYMBOLS ) && !defined( __CYGWIN__ )
+/*********************************************************
+ HAVE_WEAK_SYMBOLS:
+ */
+#define __mpu_weak_alias( name, symbol ) \
+ extern __typeof(name) symbol __attribute__ ((weak, alias( #name )))
+
+#define __MPU_WEAK 1
+
+#else /* HAVE_WEAK_SYMBOLS */
+/*********************************************************
+ don't HAVE_WEAK_SYMBOLS (for example, in Cygwin):
+ */
+#define __mpu_weak_alias( name, symbol ) \
+ __mpu_strong_alias( name, symbol )
+
+#define __MPU_WEAK 0
+
+#endif /* HAVE_WEAK_SYMBOLS */
+
+#endif /* __ASSEMBLER__ */
+
+
+#if defined( SHARED ) && defined( HAVE_HIDDEN_VISIBILITY_ATTRIBUTE )
+#define __mpu_hidden_decl(name) \
+ extern __typeof (name) __attribute__ ((visibility ("hidden"))) name
+#else
+#define __mpu_hidden_decl(name)
+#endif
+
+
+#ifdef __cplusplus
+} /* ... extern "C" */
+#endif
+
+#endif /* __MPU_SYMBOLS_H */