git ssb

0+

dangerousbeans / %aPBe2k3ugtjBr4rrsU1…



Commit 867c5009b843941a635b7f0068fb4935d9935032

Fix compilation error with VC++ 2010. Error is:

C:\MinGW\local\src\bcrypt-ruby\ext\mri\ow-crypt.h(17) : error C4028: formal parameter 1 different from declaration
C:\MinGW\local\src\bcrypt-ruby\ext\mri\ow-crypt.h(17) : error C4028: formal parameter 2 different from declaration
C:\MinGW\local\src\bcrypt-ruby\ext\mri\ow-crypt.h(17) : warning C4273: 'crypt' : inconsistent dll linkage
        c:\mingw\local\ruby\include\ruby-1.9.1\ruby/missing.h(77) : see previous definition of 'crypt'

The fix is to define _CONST as const to match the declaration in missing.h.

Note though that Ruby defines a crypt method in crypt.c.  Is this a problem?
Charlie Savage committed on 8/13/2011, 6:35:04 AM
Parent: 9689789475d1754628f9b5ba1192db34e8363313

Files changed

ext/mri/ow-crypt.hchanged
ext/mri/ow-crypt.hView
@@ -6,12 +6,13 @@
66 #ifndef _OW_CRYPT_H
77 #define _OW_CRYPT_H
88
99 #undef __CONST
10-#ifdef __GNUC__
10+#if defined __GNUC__
1111 #define __CONST __const
12+#elif defined _MSC_VER
13+#define __CONST const
1214 #else
13-#define __CONST
1415 #endif
1516
1617 #ifndef __SKIP_GNU
1718 extern char *crypt(__CONST char *key, __CONST char *setting);

Built with git-ssb-web