Math Processor Unit Library

libmpu – library of arithmetic functions for integer, real, and complex numbers of increased digit capacity

16 Commits   0 Branches   2 Tags

/***************************************************************
  __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 */