Avoid "incomprehensible" errors when required definitions are missing.
[openssl.git] / crypto / asn1 / asn1.h
index 5f113b4202f327098535aad6058c90a2ccf2abb5..8a28085d550a9b8e5a9dbbd6f37a114a82def8f6 100644 (file)
@@ -64,8 +64,8 @@ extern "C" {
 #endif
 
 #include <time.h>
-#include "bn.h"
-#include "stack.h"
+#include <openssl/bn.h>
+#include <openssl/stack.h>
 
 #define V_ASN1_UNIVERSAL               0x00
 #define        V_ASN1_APPLICATION              0x40
@@ -471,7 +471,9 @@ void                ASN1_STRING_free(ASN1_STRING *a);
 ASN1_STRING *  ASN1_STRING_dup(ASN1_STRING *a);
 ASN1_STRING *  ASN1_STRING_type_new(int type );
 int            ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b);
-int            ASN1_STRING_set(ASN1_STRING *str,unsigned char *data, int len);
+  /* Since this is used to store all sorts of things, via macros, for now, make
+     its data void * */
+int            ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
 
 int            i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp);
 ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,unsigned char **pp,
@@ -677,6 +679,9 @@ char *ASN1_unpack_string(ASN1_STRING *oct, char *(*d2i)());
 ASN1_STRING *ASN1_pack_string(char *obj, int (*i2d)(), ASN1_OCTET_STRING **oct);
 
 #else
+#error "OpenSSL cannot be used with NOPROTO defined.  The NOPROTO sections in header files exist only for automatic parsing by certain utilities."
+/* Without this, highly uncomprehensible error messages can occur
+ * when compiling something with -DNOPROTO ... */
 
 ASN1_TYPE *    ASN1_TYPE_new();
 void           ASN1_TYPE_free();
@@ -805,6 +810,10 @@ ASN1_STRING *ASN1_pack_string();
 #endif
 
 /* BEGIN ERROR CODES */
+/* The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+
 /* Error codes for the ASN1 functions. */
 
 /* Function codes. */
@@ -1047,7 +1056,7 @@ ASN1_STRING *ASN1_pack_string();
 #define ASN1_R_WRONG_PRINTABLE_TYPE                     148
 #define ASN1_R_WRONG_TAG                                149
 #define ASN1_R_WRONG_TYPE                               150
+
 #ifdef  __cplusplus
 }
 #endif