Skip to content

Commit

Permalink
autotester: Passthrough error prints from core, fix atomic fallback s…
Browse files Browse the repository at this point in the history
…ignatures
  • Loading branch information
calc84maniac committed Aug 26, 2024
1 parent 52628db commit a5c713b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
16 changes: 8 additions & 8 deletions core/atomics.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
#else
#define _Atomic(X) volatile X /* doesn't do anything, but makes me feel better... although if you are trying to do multithreading glhf */
#define atomic_load_explicit(object, order) (*(object))
static inline atomic8_fetch_and(volatile uint8_t *obj, uint8_t arg) {
static inline uint8_t atomic8_fetch_and(volatile uint8_t *obj, uint8_t arg) {
uint8_t result = *obj;
*obj = result & arg;
return result;
}
static inline atomic32_fetch_and(volatile uint32_t *obj, uint8_t arg) {
static inline uint32_t atomic32_fetch_and(volatile uint32_t *obj, uint32_t arg) {
uint32_t result = *obj;
*obj = result & arg;
return result;
}
static inline atomic8_fetch_or(volatile uint8_t *obj, uint8_t arg) {
static inline uint8_t atomic8_fetch_or(volatile uint8_t *obj, uint8_t arg) {
uint8_t result = *obj;
*obj = result | arg;
return result;
}
static inline atomic32_fetch_or(volatile uint32_t *obj, uint8_t arg) {
static inline uint32_t atomic32_fetch_or(volatile uint32_t *obj, uint32_t arg) {
uint32_t result = *obj;
*obj = result | arg;
return result;
Expand All @@ -49,22 +49,22 @@ static inline atomic32_fetch_or(volatile uint32_t *obj, uint8_t arg) {
#else
#define _Atomic(X) X
#define atomic_load_explicit(object, order) (*(object))
static inline atomic8_fetch_and(uint8_t *obj, uint8_t arg) {
static inline uint8_t atomic8_fetch_and(uint8_t *obj, uint8_t arg) {
uint8_t result = *obj;
*obj = result & arg;
return result;
}
static inline atomic32_fetch_and(uint32_t *obj, uint8_t arg) {
static inline uint32_t atomic32_fetch_and(uint32_t *obj, uint32_t arg) {
uint32_t result = *obj;
*obj = result & arg;
return result;
}
static inline atomic8_fetch_or(uint8_t *obj, uint8_t arg) {
static inline uint8_t atomic8_fetch_or(uint8_t *obj, uint8_t arg) {
uint8_t result = *obj;
*obj = result | arg;
return result;
}
static inline atomic32_fetch_or(uint32_t *obj, uint8_t arg) {
static inline uint32_t atomic32_fetch_or(uint32_t *obj, uint32_t arg) {
uint32_t result = *obj;
*obj = result | arg;
return result;
Expand Down
13 changes: 11 additions & 2 deletions tests/autotester/autotester_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <iostream>
#include <chrono>
#include <cstdarg>
#include <cstdio>
#include <cstring>

#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
Expand All @@ -28,8 +29,16 @@ namespace cemucore
extern "C"
{
void gui_console_clear() {}
void gui_console_printf(const char* format, ...) { (void)format; }
void gui_console_err_printf(const char* format, ...) { (void)format; }
void gui_console_printf(const char *format, ...) { (void)format; }
void gui_console_err_printf(const char *format, ...) {
static char message[512];
va_list ap;
va_start(ap, format);
if (vsnprintf(message, sizeof(message), format, ap) >= 0) {
std::cerr << message;
}
va_end(ap);
}
asic_rev_t gui_handle_reset(const boot_ver_t* boot_ver, asic_rev_t loaded_rev, asic_rev_t default_rev, bool* python) {
(void)boot_ver;
(void)loaded_rev;
Expand Down

0 comments on commit a5c713b

Please sign in to comment.