diff --git a/client/src/cmddata.h b/client/src/cmddata.h index 4a740f8a2..a7a69e430 100644 --- a/client/src/cmddata.h +++ b/client/src/cmddata.h @@ -13,6 +13,10 @@ #include "common.h" +#ifdef __cplusplus +extern "C" { +#endif + //#include //size_t int CmdData(const char *Cmd); @@ -82,4 +86,7 @@ extern size_t DemodBufferLen; extern int g_DemodClock; extern size_t g_DemodStartIdx; +#ifdef __cplusplus +} +#endif #endif diff --git a/client/src/comms.h b/client/src/comms.h index 288e8a326..42f5580a6 100644 --- a/client/src/comms.h +++ b/client/src/comms.h @@ -16,6 +16,10 @@ #include "pm3_cmd.h" // Packet structs #include "util.h" // FILE_PATH_SIZE +#ifdef __cplusplus +extern "C" { +#endif + #ifndef DropField #define DropField() { \ clearCommandBuffer(); SendCommandNG(CMD_HF_DROPFIELD, NULL, 0); \ @@ -83,6 +87,9 @@ bool WaitForResponse(uint32_t cmd, PacketResponseNG *response); //bool GetFromDevice(DeviceMemType_t memtype, uint8_t *dest, uint32_t bytes, uint32_t start_index, PacketResponseNG *response, size_t ms_timeout, bool show_warning); bool GetFromDevice(DeviceMemType_t memtype, uint8_t *dest, uint32_t bytes, uint32_t start_index, uint8_t *data, uint32_t datalen, PacketResponseNG *response, size_t ms_timeout, bool show_warning); +#ifdef __cplusplus +} +#endif #endif diff --git a/client/src/graph.h b/client/src/graph.h index b753f418d..a53d65c06 100644 --- a/client/src/graph.h +++ b/client/src/graph.h @@ -13,6 +13,10 @@ #include "common.h" +#ifdef __cplusplus +extern "C" { +#endif + void AppendGraph(bool redraw, uint16_t clock, int bit); size_t ClearGraph(bool redraw); bool HasGraphData(void); @@ -38,4 +42,7 @@ extern int GraphBuffer[MAX_GRAPH_TRACE_LEN]; extern size_t GraphTraceLen; extern int s_Buff[MAX_GRAPH_TRACE_LEN]; +#ifdef __cplusplus +} +#endif #endif diff --git a/client/src/proxgui.h b/client/src/proxgui.h index 4666cccc3..cc9c9e118 100644 --- a/client/src/proxgui.h +++ b/client/src/proxgui.h @@ -18,7 +18,6 @@ extern "C" { #include #include #include -//#include "comms.h" void ShowGraphWindow(void); void HideGraphWindow(void); diff --git a/client/src/proxguiqt.cpp b/client/src/proxguiqt.cpp index 7f0dcb8a8..f3f49b9a0 100644 --- a/client/src/proxguiqt.cpp +++ b/client/src/proxguiqt.cpp @@ -24,18 +24,15 @@ #include #include #include -#include "proxgui.h" #include - -extern "C" int preferences_save(void); - -extern "C" { +#include "proxgui.h" #include "ui.h" #include "comms.h" #include "graph.h" #include "cmddata.h" #include "util_darwin.h" -} + +extern "C" int preferences_save(void); bool g_useOverlays = false; int g_absVMax = 0; diff --git a/client/src/ui.h b/client/src/ui.h index 8ba9c06a4..7a2c90659 100644 --- a/client/src/ui.h +++ b/client/src/ui.h @@ -11,10 +11,14 @@ #ifndef UI_H__ #define UI_H__ -#include "common.h" #include +#include "common.h" #include "ansi.h" +#ifdef __cplusplus +extern "C" { +#endif + #define _USE_MATH_DEFINES typedef enum logLevel {NORMAL, SUCCESS, INFO, FAILED, WARNING, ERR, DEBUG, INPLACE, HINT} logLevel_t; @@ -60,4 +64,7 @@ extern pthread_mutex_t print_lock; void iceIIR_Butterworth(int *data, const size_t len); void iceSimple_Filter(int *data, const size_t len, uint8_t k); +#ifdef __cplusplus +} +#endif #endif diff --git a/client/src/util_darwin.h b/client/src/util_darwin.h index 709680cdc..001282578 100644 --- a/client/src/util_darwin.h +++ b/client/src/util_darwin.h @@ -11,9 +11,16 @@ #ifndef UTIL_DARWIN_H__ #define UTIL_DARWIN_H__ +#ifdef __cplusplus +extern "C" { +#endif + void disableAppNap(const char *reason); void enableAppNap(void); void makeUnfocusable(void); void makeFocusable(void); +#ifdef __cplusplus +} +#endif #endif