From 0749b34a205f31589c57fbf6d071e7f81a3e1abb Mon Sep 17 00:00:00 2001 From: hodasemi Date: Thu, 10 Feb 2022 08:40:58 +0100 Subject: [PATCH] Fix build and create makefile --- .vscode/settings.json | 5 +++++ Include/InternalsPlugin.hpp | 13 ++----------- Include/RFServer.hpp | 6 +++--- Include/Socket.hpp | 4 ++-- Makefile | 13 +++++++++++++ 5 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 Makefile diff --git a/.vscode/settings.json b/.vscode/settings.json index 153512a..c408ffd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -43,5 +43,10 @@ "xlocinfo": "cpp", "xlocnum": "cpp", "xmemory": "cpp" + }, + "workbench.colorCustomizations": { + "activityBar.background": "#232E44", + "titleBar.activeBackground": "#30405F", + "titleBar.activeForeground": "#F9FAFC" } } \ No newline at end of file diff --git a/Include/InternalsPlugin.hpp b/Include/InternalsPlugin.hpp index c1edc4f..056b0dc 100644 --- a/Include/InternalsPlugin.hpp +++ b/Include/InternalsPlugin.hpp @@ -18,17 +18,8 @@ #define _INTERNALS_PLUGIN_HPP_ #include "PluginObjects.hpp" // base class for plugin objects to derive from -// #include // for sqrt() -// #include // for HWND - -struct HWND -{ - int d; -}; - -double sqrt(double d) { - return d; -} +#include // for sqrt() +#include // for HWND // rF and plugins must agree on structure packing, so set it explicitly here ... whatever the current // packing is will be restored at the end of this include with another #pragma. diff --git a/Include/RFServer.hpp b/Include/RFServer.hpp index 5df445a..722646a 100644 --- a/Include/RFServer.hpp +++ b/Include/RFServer.hpp @@ -2,8 +2,8 @@ #ifndef _RF_SERVER_H #define _RF_SERVER_H -#include "InternalsPlugin.hpp" #include "Socket.hpp" +#include "InternalsPlugin.hpp" // This is used for the app to use the plugin for its intended purpose class RFServerPlugin : public InternalsPluginV07 // REMINDER: exported function GetPluginVersion() should return 1 if you are deriving from this InternalsPluginV01, 2 for InternalsPluginV02, etc. @@ -26,11 +26,11 @@ public: void EndSession(); // session has ended // GAME OUTPUT - long WantsTelemetryUpdates() { return (1); } // CHANGE TO 1 TO ENABLE TELEMETRY EXAMPLE! + long WantsTelemetryUpdates() { return (1); } void UpdateTelemetry(const TelemInfoV01 &info); // SCORING OUTPUT - bool WantsScoringUpdates() { return (false); } // CHANGE TO TRUE TO ENABLE SCORING EXAMPLE! + bool WantsScoringUpdates() { return (true); } void UpdateScoring(const ScoringInfoV01 &info); bool WantsPitMenuAccess() { return (true); } diff --git a/Include/Socket.hpp b/Include/Socket.hpp index 7d5964a..fbdfc7d 100644 --- a/Include/Socket.hpp +++ b/Include/Socket.hpp @@ -1,8 +1,8 @@ #ifndef _SOCKET_HPP_ #define _SOCKET_HPP_ -#include -#include +#include +#include #include #pragma comment(lib, "Ws2_32.lib") diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..83c0748 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +CC = x86_64-w64-mingw32-g++ +INCLUDES = -I "Include/" -I "/usr/x86_64-w64-mingw32/include" +LIBRARIES = -L/usr/x86_64-w64-mingw32/lib -lws2_32 +SOURCES = Source/RFServer.cpp + +.PHONY: all clean install + +all: + $(CC) -O3 -c $(SOURCES) $(INCLUDES) + $(CC) -O3 -shared -o RFServer.dll RFServer.o $(LIBRARIES) + +clean: + -rm RFServer.dll RFServer.o