rework C includes in C++

This commit is contained in:
Philippe Teuwen 2020-05-03 12:46:46 +02:00
parent 19be62f7e6
commit ed1fb14f5f
7 changed files with 39 additions and 8 deletions

View file

@ -13,6 +13,10 @@
#include "common.h"
#ifdef __cplusplus
extern "C" {
#endif
//#include <stdlib.h> //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

View file

@ -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

View file

@ -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

View file

@ -18,7 +18,6 @@ extern "C" {
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
//#include "comms.h"
void ShowGraphWindow(void);
void HideGraphWindow(void);

View file

@ -24,18 +24,15 @@
#include <QSlider>
#include <QHBoxLayout>
#include <string.h>
#include "proxgui.h"
#include <QtGui>
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;

View file

@ -11,10 +11,14 @@
#ifndef UI_H__
#define UI_H__
#include "common.h"
#include <pthread.h>
#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

View file

@ -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