Initial C version

This commit is contained in:
Jordon Brooks 2024-05-22 13:42:37 +01:00
parent fa0e309875
commit d5b097c6ec
Signed by: jordon
GPG key ID: DBD9758CD53E786A
33 changed files with 123 additions and 1969 deletions

View file

@ -1,4 +1,4 @@
// Copyright (c) 2024 Jordon Brooks
// Copyright (c) 2024 Jordon Brooks
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -12,49 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* IMPORTANT REMINDER:
* Do NOT use standard output functions like std::cout and printf anywhere in this codebase.
*
* Reason:
* Unreal Engine 5's packaging tool encounters issues with these functions, leading to
* packaging failures. The engine sets stdout to UTF-8, which can cause conflicts with
* these standard functions, resulting in a "SECURE CRT: Invalid parameter detected" error
* during packaging.
*
* This issue once required an extensive debugging effort that lasted over 8 hours.
* To prevent similar issues in the future and ensure smooth packaging, always use
* wide-character versions of these functions, such as wprintf and std::wcout, when working
* within the DLL. These functions are compatible with the UTF-8 setting in Unreal Engine 5.
*
*/
#pragma once
#include <stdbool.h>
#include "Core.h"
#include "Structs/FBattery.h"
#include "Structs/FCPUInfo.h"
#include "Structs/FDevice.h"
#include "Structs/FOSVerInfo.h"
class IPlatformUtilities;
namespace HarmonyLinkLib
{
extern "C" HARMONYLINKLIB_API bool get_is_wine();
extern "C" HARMONYLINKLIB_API bool get_is_linux();
extern "C" HARMONYLINKLIB_API bool get_is_docked();
extern "C" HARMONYLINKLIB_API FCPUInfo* get_cpu_info();
extern "C" HARMONYLINKLIB_API FDevice* get_device_info();
extern "C" HARMONYLINKLIB_API FOSVerInfo* get_os_version();
extern "C" HARMONYLINKLIB_API FBattery* get_battery_status();
}
HARMONYLINKLIB_API bool HarmonyLink_Init(void);