Browse Source

Merge pull request #210 from libtom/pr/aix-fix

IBM xlc compiler related fixes
karel-m 8 years ago
parent
commit
b439f83018
2 changed files with 8 additions and 4 deletions
  1. 2 2
      src/headers/tomcrypt_cfg.h
  2. 6 2
      src/modes/xts/xts_test.c

+ 2 - 2
src/headers/tomcrypt_cfg.h

@@ -41,8 +41,8 @@ LTC_EXPORT int   LTC_CALL XSTRCMP(const char *s1, const char *s2);
 
 
 #endif
 #endif
 
 
-/* some compilers do not like "inline" */
-#if defined(__HP_cc)
+/* some compilers do not like "inline" (or maybe "static inline"), namely: HP cc, IBM xlc */
+#if defined(__HP_cc) || defined(__xlc__)
    #define LTC_INLINE
    #define LTC_INLINE
 #elif defined(_MSC_VER)
 #elif defined(_MSC_VER)
    #define LTC_INLINE __inline
    #define LTC_INLINE __inline

+ 6 - 2
src/modes/xts/xts_test.c

@@ -17,7 +17,9 @@ static int _xts_test_accel_xts_encrypt(const unsigned char *pt, unsigned char *c
 {
 {
    int ret;
    int ret;
    symmetric_xts xts;
    symmetric_xts xts;
-   void *orig;
+   int (*orig)(const unsigned char *, unsigned char *,
+               unsigned long , unsigned char *, symmetric_key *,
+               symmetric_key *);
 
 
    /* AES can be under rijndael or aes... try to find it */
    /* AES can be under rijndael or aes... try to find it */
    if ((xts.cipher = find_cipher("aes")) == -1) {
    if ((xts.cipher = find_cipher("aes")) == -1) {
@@ -42,7 +44,9 @@ static int _xts_test_accel_xts_decrypt(const unsigned char *ct, unsigned char *p
 {
 {
    int ret;
    int ret;
    symmetric_xts xts;
    symmetric_xts xts;
-   void *orig;
+   int (*orig)(const unsigned char *, unsigned char *,
+               unsigned long , unsigned char *, symmetric_key *,
+               symmetric_key *);
 
 
    /* AES can be under rijndael or aes... try to find it */
    /* AES can be under rijndael or aes... try to find it */
    if ((xts.cipher = find_cipher("aes")) == -1) {
    if ((xts.cipher = find_cipher("aes")) == -1) {