From 64926a3797478b1717b43e2b33f9745ee624e860 Mon Sep 17 00:00:00 2001 From: JailDoctor Date: Tue, 8 Sep 2026 18:08:14 +0200 Subject: [PATCH] - [FIX] Corregits errors per a que compile en Windows --- .gitignore | 4 +++- Score.cpp | 1 + api.h | 18 +++++++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e651c6a..4f5c5ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ syntax: glob mathwars +mathwars.exe recursos/* bin/* obj/* @@ -16,4 +17,5 @@ data/* trick.ini *.xcuserstate project.xcworkspace/ -xcuserdata/ \ No newline at end of file +xcuserdata/ +*.zip \ No newline at end of file diff --git a/Score.cpp b/Score.cpp index 1e481fa..7a849db 100644 --- a/Score.cpp +++ b/Score.cpp @@ -1,5 +1,6 @@ #include "Score.h" #include "api.h" +#include namespace { int lives = 3; diff --git a/api.h b/api.h index 02f8ac1..3f12c53 100644 --- a/api.h +++ b/api.h @@ -4,7 +4,23 @@ #include "System.h" #include -#define message_eq(m) (strncmp(msg, m, 20)==0) +// En tu archivo .h común (ej. mensajes.h) + +static inline int message_eq_func(const char *msg, const char *m) { + // Compara carácter por carácter hasta el final de la cadena 'm' o máximo 20 + for (int i = 0; i < 20; i++) { + if (msg[i] != m[i]) { + return 0; // No son iguales + } + if (m[i] == '\0') { + return 1; // Llegamos al final de 'm' y coinciden perfectamente + } + } + return 1; // Llegó a 20 caracteres idénticos +} + +// Tu macro ahora llama a esta función inline +#define message_eq(m) message_eq_func(msg, m) enum BlendMode { BlendNone, BlendBlend, BlendAdd, BlendMod };