Commit 1e159bc6fa8fdeb9bd5c3daf0aaccc6cf73e16d6

Sam Lantinga 2021-11-11T13:45:31

Include standard wrapping for SDL public headers in SDL_hidapi.h

diff --git a/include/SDL_hidapi.h b/include/SDL_hidapi.h
index 9264cf1..7ce86b8 100644
--- a/include/SDL_hidapi.h
+++ b/include/SDL_hidapi.h
@@ -62,6 +62,14 @@
 #ifndef SDL_hidapi_h_
 #define SDL_hidapi_h_
 
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  *  \brief  A handle representing an open HID device
  */
@@ -113,6 +121,7 @@ typedef struct SDL_hid_device_info
     struct SDL_hid_device_info *next;
 } SDL_hid_device_info;
 
+
 /**
  * Initialize the HIDAPI library.
  *
@@ -423,6 +432,12 @@ extern DECLSPEC int SDLCALL SDL_hid_get_serial_number_string(SDL_hid_device *dev
  */
 extern DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, int string_index, wchar_t *string, size_t maxlen);
 
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
 #endif /* SDL_hidapi_h_ */
 
 /* vi: set sts=4 ts=4 sw=4 expandtab: */