From 0c226834ccdb715705d0387eb714696299725110 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sat, 2 Jan 2016 17:37:06 +0100 Subject: [PATCH] introducing LTC_INLINE --- src/headers/tomcrypt_cfg.h | 9 +++++++++ src/pk/dh/dh_static.h | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index c2aa3e1..114aacc 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -43,6 +43,15 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #endif +/* some compilers do not like "inline" */ +#if defined(__HP_cc) + #define LTC_INLINE +#elif defined(_MSC_VER) + #define LTC_INLINE __inline +#else + #define LTC_INLINE inline +#endif + /* type of argument checking, 0=default, 1=fatal and 2=error+continue, 3=nothing */ #ifndef ARGTYPE #define ARGTYPE 0 diff --git a/src/pk/dh/dh_static.h b/src/pk/dh/dh_static.h index 273b175..5a47ee0 100644 --- a/src/pk/dh/dh_static.h +++ b/src/pk/dh/dh_static.h @@ -69,7 +69,7 @@ y += x; \ } -static inline void packet_store_header (unsigned char *dst, int section, int subsection) +static LTC_INLINE void packet_store_header (unsigned char *dst, int section, int subsection) { LTC_ARGCHKVD(dst != NULL); @@ -83,7 +83,7 @@ static inline void packet_store_header (unsigned char *dst, int section, int sub } -static inline int packet_valid_header (unsigned char *src, int section, int subsection) +static LTC_INLINE int packet_valid_header (unsigned char *src, int section, int subsection) { unsigned long ver;