From 1e159bc6fa8fdeb9bd5c3daf0aaccc6cf73e16d6 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 11 Nov 2021 13:45:31 -0800
Subject: [PATCH] Include standard wrapping for SDL public headers in
SDL_hidapi.h
---
include/SDL_hidapi.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/include/SDL_hidapi.h b/include/SDL_hidapi.h
index 9264cf1d29..7ce86b8952 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: */