HP-UX related fixes
Karel Miko
8 years ago
12 | 12 |
- maybe: add enc_b64/dec_b64 + enc_b64u/dec_b64u + enc_b32/dec_b32
|
13 | 13 |
- maybe: x509_rsa_pubkey + x509_rsa_pubkey_alg
|
14 | 14 |
|
15 | |
0.026_01..03 2015/12/29
|
|
15 |
0.026_04 2015/12/31
|
16 | 16 |
- sync with https://github.com/libtom/libtomcrypt (branch develop)
|
17 | |
- 0.026_02 = with -Wall
|
18 | |
- 0.026_03 = with -DLTC_NO_FAST
|
|
17 |
- HP-UX related fixes
|
19 | 18 |
|
20 | 19 |
0.026 2015/11/28
|
21 | 20 |
- switch to JSON::MaybeXS
|
81 | 81 |
#define LTC_FAST
|
82 | 82 |
#endif
|
83 | 83 |
|
|
84 |
/* detect HP-UX */
|
|
85 |
#if defined(__hpux) || defined(__hpux__)
|
|
86 |
#define ENDIAN_BIG
|
|
87 |
#if defined(__ia64) || defined(__ia64__) || defined(__LP64__)
|
|
88 |
#define ENDIAN_64BITWORD
|
|
89 |
#else
|
|
90 |
#define ENDIAN_32BITWORD
|
|
91 |
#endif
|
|
92 |
#endif
|
|
93 |
|
84 | 94 |
/* fix for MSVC ...evil! */
|
85 | 95 |
#ifdef _MSC_VER
|
86 | 96 |
#define CONST64(n) n ## ui64
|
|
93 | 103 |
/* this is the "32-bit at least" data type
|
94 | 104 |
* Re-define it to suit your platform but it must be at least 32-bits
|
95 | 105 |
*/
|
96 | |
#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__))
|
|
106 |
#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__LP64__)
|
97 | 107 |
typedef unsigned ulong32;
|
98 | 108 |
#else
|
99 | 109 |
typedef unsigned long ulong32;
|
100 | 110 |
#endif
|
101 | 111 |
|
102 | |
#ifdef LTC_NO_FAST
|
|
112 |
#if defined(LTC_NO_FAST) || (__GNUC__ < 4)
|
103 | 113 |
#undef LTC_FAST
|
104 | 114 |
#endif
|
105 | 115 |
|
106 | 116 |
#ifdef LTC_FAST
|
107 | |
#if __GNUC__ < 4 /* if the compiler does not support gnu extensions, i.e. its neither clang nor gcc nor icc */
|
108 | |
#error the LTC_FAST hack is only available on compilers that support __attribute__((may_alias)) - disable it for your compiler, and dont worry, it won`t buy you much anyway
|
109 | |
#else
|
110 | 117 |
#ifdef ENDIAN_64BITWORD
|
111 | 118 |
typedef ulong64 __attribute__((__may_alias__)) LTC_FAST_TYPE;
|
112 | 119 |
#else
|
113 | 120 |
typedef ulong32 __attribute__((__may_alias__)) LTC_FAST_TYPE;
|
114 | 121 |
#endif
|
115 | 122 |
#endif
|
116 | |
#endif /* LTC_FAST */
|
117 | 123 |
|
118 | 124 |
/* detect sparc and sparc64 */
|
119 | 125 |
#if defined(__sparc__)
|
68 | 68 |
y += x; \
|
69 | 69 |
}
|
70 | 70 |
|
|
71 |
#ifdef __HP_cc
|
|
72 |
static void packet_store_header (unsigned char *dst, int section, int subsection)
|
|
73 |
#else
|
71 | 74 |
static inline void packet_store_header (unsigned char *dst, int section, int subsection)
|
|
75 |
#endif
|
72 | 76 |
{
|
73 | 77 |
LTC_ARGCHKVD(dst != NULL);
|
74 | 78 |
|
|
82 | 86 |
|
83 | 87 |
}
|
84 | 88 |
|
|
89 |
#ifdef __HP_cc
|
|
90 |
static int packet_valid_header (unsigned char *src, int section, int subsection)
|
|
91 |
#else
|
85 | 92 |
static inline int packet_valid_header (unsigned char *src, int section, int subsection)
|
|
93 |
#endif
|
86 | 94 |
{
|
87 | 95 |
unsigned long ver;
|
88 | 96 |
|