summaryrefslogtreecommitdiff
path: root/games/stepmania-devel/files/patch-tomcrypt_macros.h
blob: dd6a74551013f1a14a79c4e466117b8c44038dc8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
--- src/libtomcrypt/src/headers/tomcrypt_macros.h.orig	2015-06-20 16:57:25 UTC
+++ src/libtomcrypt/src/headers/tomcrypt_macros.h
@@ -262,21 +262,19 @@ static inline __attribute__((always_inli
 
 #ifndef LTC_NO_ROLC
 
-static inline __attribute__((always_inline)) unsigned ROLc(unsigned word, const int i)
-{
-   asm ("roll %2,%0"
-      :"=r" (word)
-      :"0" (word),"I" (i));
-   return word;
-}
+#define ROLc(word, i) ({     \
+   unsigned _word = word;    \
+   asm ("roll %2,%0"         \
+      :"=r" (_word)          \
+      :"0" (_word),"I" (i)); \
+   _word; })
 
-static inline __attribute__((always_inline)) unsigned RORc(unsigned word, const int i)
-{
-   asm ("rorl %2,%0"
-      :"=r" (word)
-      :"0" (word),"I" (i));
-   return word;
-}
+#define RORc(word, i) ({     \
+   unsigned _word = word;    \
+   asm ("rorl %2,%0"         \
+      :"=r" (_word)          \
+      :"0" (_word),"I" (i)); \
+   _word; })
 
 #else
 
@@ -305,21 +303,19 @@ static inline __attribute__((always_inli
 
 #ifndef LTC_NO_ROLC
 
-static inline __attribute__((always_inline)) unsigned ROLc(unsigned word, const int i)
-{
-   asm ("rotlwi %0,%0,%2"
-      :"=r" (word)
-      :"0" (word),"I" (i));
-   return word;
-}
+#define ROLc(word, i) ({     \
+   unsigned _word = word;    \
+   asm ("rotlwi %0,%0,%2"    \
+      :"=r" (_word)          \
+      :"0" (_word),"I" (i)); \
+   _word; })
 
-static inline __attribute__((always_inline)) unsigned RORc(unsigned word, const int i)
-{
-   asm ("rotrwi %0,%0,%2"
-      :"=r" (word)
-      :"0" (word),"I" (i));
-   return word;
-}
+#define RORc(word, i) ({     \
+   unsigned _word = word;    \
+   asm ("rotrwi %0,%0,%2"    \
+      :"=r" (_word)          \
+      :"0" (_word),"I" (i)); \
+   _word; })
 
 #else
 
@@ -361,21 +357,19 @@ static inline __attribute__((always_inli
 
 #ifndef LTC_NO_ROLC
 
-static inline __attribute__((always_inline)) unsigned long ROL64c(unsigned long word, const int i)
-{
-   asm("rolq %2,%0"
-      :"=r" (word)
-      :"0" (word),"J" (i));
-   return word;
-}
+#define ROL64c(word, i) ({     \
+   unsigned long _word = word; \
+   asm ("rolq %2,%0"           \
+      :"=r" (_word)            \
+      :"0" (_word),"J" (i));   \
+   _word; })
 
-static inline __attribute__((always_inline)) unsigned long ROR64c(unsigned long word, const int i)
-{
-   asm("rorq %2,%0"
-      :"=r" (word)
-      :"0" (word),"J" (i));
-   return word;
-}
+#define ROR64c(word, i) ({     \
+   unsigned long _word = word; \
+   asm ("rorq %2,%0"           \
+      :"=r" (_word)            \
+      :"0" (_word),"J" (i));   \
+   _word; })
 
 #else /* LTC_NO_ROLC */