WIN32 fixes.
[openssl.git] / crypto / stack / safestack.h
index e5827ca81f0ec48a748b3651883192bd3c531ca2..53c1695f2a5bed750a09009553dbf2a165a12247 100644 (file)
 
 #include <openssl/stack.h>
 
-#ifdef OPENSSL_NO_FCAST
+#ifndef OPENSSL_ALLOW_FCAST
 
 #ifndef OPENSSL_INLINE
-#define OPENSSL_INLINE static inline
+#ifdef OPENSSL_SYSNAME_WIN32
+#define OPENSSL_INLINE __inline static
+#else
+#define OPENSSL_INLINE inline static
+#endif
 #endif
 
 #define STACK_OF(type) struct stack_st_##type
@@ -74,7 +78,7 @@ STACK_OF(type) \
     }; \
 OPENSSL_INLINE STACK_OF(type) *sk_##type##_new( \
        int (*cmp)(const type * const *, const type *const *)) \
-    { return (STACK_OF(type) *)sk_new((int (*)())cmp); } \
+    { return (STACK_OF(type) *)sk_new((int (*)(const char * const *, const char * const *))cmp); } \
 OPENSSL_INLINE STACK_OF(type) *sk_##type##_new_null() \
     { return (STACK_OF(type) *)sk_new_null(); } \
 OPENSSL_INLINE void sk_##type##_free(STACK_OF(type) *sk) \
@@ -803,6 +807,7 @@ STACK_OF(type) \
 #define sk_GENERAL_SUBTREE_sort(st) SKM_sk_sort(GENERAL_SUBTREE, (st))
 #define sk_GENERAL_SUBTREE_is_sorted(st) SKM_sk_is_sorted(GENERAL_SUBTREE, (st))
 
+#ifndef OPENSSL_NO_RFC3779
 #define sk_IPAddressFamily_new(st) SKM_sk_new(IPAddressFamily, (st))
 #define sk_IPAddressFamily_new_null() SKM_sk_new_null(IPAddressFamily)
 #define sk_IPAddressFamily_free(st) SKM_sk_free(IPAddressFamily, (st))
@@ -846,6 +851,7 @@ STACK_OF(type) \
 #define sk_IPAddressOrRange_pop(st) SKM_sk_pop(IPAddressOrRange, (st))
 #define sk_IPAddressOrRange_sort(st) SKM_sk_sort(IPAddressOrRange, (st))
 #define sk_IPAddressOrRange_is_sorted(st) SKM_sk_is_sorted(IPAddressOrRange, (st))
+#endif /* OPENSSL_NO_RFC3779 */
 
 #define sk_KRB5_APREQBODY_new(st) SKM_sk_new(KRB5_APREQBODY, (st))
 #define sk_KRB5_APREQBODY_new_null() SKM_sk_new_null(KRB5_APREQBODY)