-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from lucas-engen/dev
Improve x64 support
- Loading branch information
Showing
13 changed files
with
443 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,4 @@ CTestTestfile.cmake | |
_deps | ||
|
||
# Autorevision generated file | ||
#autorevision.h | ||
autorevision* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
#include <stdio.h> | ||
#include <stdarg.h> | ||
#include "logger.h" | ||
|
||
#if defined(DEBUG) || !defined(NDEBUG) | ||
void libhack_debug(const char *msg, ...) | ||
{ | ||
va_list list; | ||
|
||
va_start(list, msg); | ||
fprintf(stdout, "[LIBHACK DEBUG] "); | ||
vfprintf(stdout, msg, list); | ||
fprintf(stdout, "\n"); | ||
va_end(list); | ||
} | ||
|
||
void libhack_warn(const char *msg, ...) | ||
{ | ||
va_list list; | ||
|
||
va_start(list, msg); | ||
fprintf(stdout, "[LIBHACK WARNING] "); | ||
vfprintf(stdout, msg, list); | ||
fprintf(stdout, "\n"); | ||
va_end(list); | ||
} | ||
|
||
void libhack_notice(const char *msg, ...) | ||
{ | ||
va_list list; | ||
|
||
va_start(list, msg); | ||
fprintf(stdout, "[LIBHACK INFO] "); | ||
vfprintf(stdout, msg, list); | ||
fprintf(stdout, "\n"); | ||
va_end(list); | ||
} | ||
|
||
void libhack_err(const char *msg, ...) | ||
{ | ||
va_list list; | ||
|
||
va_start(list, msg); | ||
fprintf(stdout, "[LIBHACK ERROR] "); | ||
vfprintf(stdout, msg, list); | ||
fprintf(stdout, "\n"); | ||
va_end(list); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef LOGGER_H | ||
#define LOGGER_H | ||
|
||
/** | ||
* @brief Shows a message if the program is being debugged | ||
* | ||
*/ | ||
|
||
#if defined(DEBUG) || !defined(NDEBUG) | ||
extern void libhack_debug(const char *msg, ...); | ||
extern void libhack_warn(const char *msg, ...); | ||
extern void libhack_notice(const char *msg, ...); | ||
extern void libhack_err(const char *msg, ...); | ||
#else | ||
#define libhack_debug(...) | ||
#define libhack_warn(...) | ||
#define libhack_notice(...) | ||
#define libhack_err(...) | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef PLATFORM_H | ||
#define PLATFORM_H | ||
|
||
|
||
#if defined(__MINGW64__) || defined(_WIN64) | ||
#define __x64__ | ||
#elif __MINGW32__ || defined(_WIN32) | ||
#define __x86__ | ||
#else | ||
#error "Unknown platform detected" | ||
#endif | ||
|
||
#endif // PLATFORM_H |
Oops, something went wrong.