Commit 17b08b6a authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

PR: 1644

Submitted by: steve@openssl.org

Fix to make DHparams_dup() et al work in C++.

For 0.9.8, we just change the macro to avoid making incompatible changes to
the API.
parent 197ab47b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -344,6 +344,8 @@ typedef struct ASN1_VALUE_st ASN1_VALUE;
    ((void*) (1 ? p : (type*)0))
#define CHECKED_PPTR_OF(type, p) \
    ((void**) (1 ? p : (type**)0))
#define CHECKED_PTR_OF_TO_CHAR(type, p) \
    ((char*) (1 ? p : (type*)0))

#define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)
#define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **)
@@ -933,12 +935,12 @@ void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x);
#define ASN1_dup_of(type,i2d,d2i,x) \
    ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \
		     CHECKED_D2I_OF(type, d2i), \
		     CHECKED_PTR_OF(type, x)))
		     CHECKED_PTR_OF_TO_CHAR(type, x)))

#define ASN1_dup_of_const(type,i2d,d2i,x) \
    ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \
		     CHECKED_D2I_OF(type, d2i), \
		     CHECKED_PTR_OF(const type, x)))
		     CHECKED_PTR_OF_TO_CHAR(const type, x)))

void *ASN1_item_dup(const ASN1_ITEM *it, void *x);