]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
header: define public API functions as extern c
authorJay Satiro <raysatiro@yahoo.com>
Wed, 7 Sep 2022 07:07:28 +0000 (03:07 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Thu, 8 Sep 2022 15:54:32 +0000 (11:54 -0400)
Prior to this change linker errors would occur if curl_easy_header or
curl_easy_nextheader was called from a C++ unit.

Bug: https://github.com/curl/curl/issues/9424#issuecomment-1238818007
Reported-by: Andrew Lambert
Closes https://github.com/curl/curl/pull/9446

include/curl/header.h

index 6af29c0c0a4b1feaad29a344134b44fd98a77808..1598c6f11390fcb3d24b36dd9472d3ec2f132d55 100644 (file)
  *
  ***************************************************************************/
 
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
 struct curl_header {
   char *name;    /* this might not use the same case */
   char *value;
@@ -63,4 +67,8 @@ CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *easy,
                                                      int request,
                                                      struct curl_header *prev);
 
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
 #endif /* CURLINC_HEADER_H */