Tweaks
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(P2FA)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/libs/include)
|
||||
link_directories(${CMAKE_SOURCE_DIR}/libs)
|
||||
|
||||
add_library(p2fa SHARED src/p2fa.c
|
||||
src/images.c)
|
||||
|
||||
target_link_libraries(p2fa)
|
||||
|
||||
set_target_properties(p2fa PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/build"
|
||||
OUTPUT_NAME "p2fa"
|
||||
)
|
||||
@@ -1,4 +0,0 @@
|
||||
Get-ChildItem -Path build -Recurse | Remove-Item -force -recurse
|
||||
if (Test-Path -Path .\build) { Remove-Item -Path .\build -Recurse -Force }
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -G "CodeBlocks - MinGW Makefiles" -S . -B .\build
|
||||
cmake --build .\build --target p2fa -- -j 14
|
||||
@@ -1,85 +0,0 @@
|
||||
/* Code generated by cmd/cgo; DO NOT EDIT. */
|
||||
|
||||
/* package P2FA */
|
||||
|
||||
|
||||
#line 1 "cgo-builtin-export-prolog"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifndef GO_CGO_EXPORT_PROLOGUE_H
|
||||
#define GO_CGO_EXPORT_PROLOGUE_H
|
||||
|
||||
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
||||
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* Start of preamble from import "C" comments. */
|
||||
|
||||
|
||||
|
||||
|
||||
/* End of preamble from import "C" comments. */
|
||||
|
||||
|
||||
/* Start of boilerplate cgo prologue. */
|
||||
#line 1 "cgo-gcc-export-header-prolog"
|
||||
|
||||
#ifndef GO_CGO_PROLOGUE_H
|
||||
#define GO_CGO_PROLOGUE_H
|
||||
|
||||
typedef signed char GoInt8;
|
||||
typedef unsigned char GoUint8;
|
||||
typedef short GoInt16;
|
||||
typedef unsigned short GoUint16;
|
||||
typedef int GoInt32;
|
||||
typedef unsigned int GoUint32;
|
||||
typedef long long GoInt64;
|
||||
typedef unsigned long long GoUint64;
|
||||
typedef GoInt64 GoInt;
|
||||
typedef GoUint64 GoUint;
|
||||
typedef size_t GoUintptr;
|
||||
typedef float GoFloat32;
|
||||
typedef double GoFloat64;
|
||||
#ifdef _MSC_VER
|
||||
#include <complex.h>
|
||||
typedef _Fcomplex GoComplex64;
|
||||
typedef _Dcomplex GoComplex128;
|
||||
#else
|
||||
typedef float _Complex GoComplex64;
|
||||
typedef double _Complex GoComplex128;
|
||||
#endif
|
||||
|
||||
/*
|
||||
static assertion to make sure the file is being used on architecture
|
||||
at least with matching size of GoInt.
|
||||
*/
|
||||
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
|
||||
|
||||
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
||||
typedef _GoString_ GoString;
|
||||
#endif
|
||||
typedef void *GoMap;
|
||||
typedef void *GoChan;
|
||||
typedef struct { void *t; void *v; } GoInterface;
|
||||
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
|
||||
|
||||
#endif
|
||||
|
||||
/* End of boilerplate cgo prologue. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern __declspec(dllexport) void loadConfigs();
|
||||
extern __declspec(dllexport) GoSlice getConfigNames();
|
||||
extern __declspec(dllexport) GoString getCode(GoString configName);
|
||||
extern __declspec(dllexport) GoUint64 getTimeRemaining(GoInt n);
|
||||
extern __declspec(dllexport) GoUint64 getTimeRemainingMS(GoInt n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -27,7 +27,8 @@ int draw() {
|
||||
|
||||
Paint_Clear(WHITE);
|
||||
const char *confName = "default";
|
||||
Paint_DrawString(5, 5, getCode(GoString{confName, strlen(confName)}).p, &Font24, WHITE, BLACK);
|
||||
GoString confStr = {confName, strlen(confName)};
|
||||
Paint_DrawString(5, 5, getCode(confStr).p, &Font24, WHITE, BLACK);
|
||||
|
||||
DEV_Delay_ms(5000);
|
||||
|
||||
|
||||
14
c/src/p2fa.h
14
c/src/p2fa.h
@@ -1,14 +0,0 @@
|
||||
//
|
||||
// Created by steven on 11/14/2024.
|
||||
//
|
||||
|
||||
#ifndef P2FA_P2FA_H
|
||||
#define P2FA_P2FA_H
|
||||
|
||||
void Handler(int sigNum);
|
||||
|
||||
//__declspec(dllexport) void init();
|
||||
|
||||
__declspec(dllexport) int draw();
|
||||
|
||||
#endif //P2FA_P2FA_H
|
||||
Reference in New Issue
Block a user