10
10
* may not be compiled always. -- marko
11
11
*/
12
12
13
- #include <postgres.h>
13
+ #include "postgres.h"
14
+
14
15
#include "px-crypt.h"
15
16
16
17
#include <errno.h>
17
18
#ifndef __set_errno
18
- #define __set_errno (val ) errno = (val)
19
- #endif
20
-
21
- #undef __CONST
22
- #ifdef __GNUC__
23
- #define __CONST __const
24
- #else
25
- #define __CONST
19
+ #define __set_errno (val ) (errno = (val))
26
20
#endif
27
21
28
22
typedef unsigned int BF_word ;
@@ -31,7 +25,7 @@ unsigned char _crypt_itoa64[64 + 1] =
31
25
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ;
32
26
33
27
char * _crypt_gensalt_traditional_rn (unsigned long count ,
34
- __CONST char * input , int size , char * output , int output_size )
28
+ const char * input , int size , char * output , int output_size )
35
29
{
36
30
if (size < 2 || output_size < 2 + 1 || (count && count != 25 )) {
37
31
if (output_size > 0 ) output [0 ] = '\0' ;
@@ -47,7 +41,7 @@ char *_crypt_gensalt_traditional_rn(unsigned long count,
47
41
}
48
42
49
43
char * _crypt_gensalt_extended_rn (unsigned long count ,
50
- __CONST char * input , int size , char * output , int output_size )
44
+ const char * input , int size , char * output , int output_size )
51
45
{
52
46
unsigned long value ;
53
47
@@ -80,7 +74,7 @@ char *_crypt_gensalt_extended_rn(unsigned long count,
80
74
}
81
75
82
76
char * _crypt_gensalt_md5_rn (unsigned long count ,
83
- __CONST char * input , int size , char * output , int output_size )
77
+ const char * input , int size , char * output , int output_size )
84
78
{
85
79
unsigned long value ;
86
80
@@ -121,7 +115,7 @@ char *_crypt_gensalt_md5_rn(unsigned long count,
121
115
static unsigned char BF_itoa64 [64 + 1 ] =
122
116
"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" ;
123
117
124
- static void BF_encode (char * dst , __CONST BF_word * src , int size )
118
+ static void BF_encode (char * dst , const BF_word * src , int size )
125
119
{
126
120
unsigned char * sptr = (unsigned char * )src ;
127
121
unsigned char * end = sptr + size ;
@@ -154,7 +148,7 @@ static void BF_encode(char *dst, __CONST BF_word *src, int size)
154
148
}
155
149
156
150
char * _crypt_gensalt_blowfish_rn (unsigned long count ,
157
- __CONST char * input , int size , char * output , int output_size )
151
+ const char * input , int size , char * output , int output_size )
158
152
{
159
153
if (size < 16 || output_size < 7 + 22 + 1 ||
160
154
(count && (count < 4 || count > 31 ))) {
0 commit comments