add GCC asm, new RCT2_ERR macro for non-variadic error reporting

This commit is contained in:
anyc 2014-05-24 16:23:30 +02:00
parent 7da7e483a3
commit b53dea17c6
3 changed files with 8 additions and 3 deletions

View File

@ -52,6 +52,7 @@ typedef unsigned long long uint64;
#else
#define RCT2_ERROR(format,...) fprintf(stderr, "ERROR %s:%s():%d: " format "\n", __FILE__, __func__, __LINE__, __VA_ARGS__);
#endif
#define RCT2_ERR(msg) RCT2_ERROR("%s",msg)
#ifndef _MSC_VER
// use similar struct packing as MSVC for our structs

View File

@ -169,7 +169,7 @@ static int scenario_scores_load()
// Try and load the scores file
file = fopen(get_file_path(PATH_ID_SCORES), "rb");
if (file == NULL) {
RCT2_ERROR("Unable to load scenario scores.");
RCT2_ERR("Unable to load scenario scores.");
return 0;
}
@ -177,7 +177,7 @@ static int scenario_scores_load()
rct_scenario_scores_header header;
if (fread(&header, 16, 1, file) != 1) {
fclose(file);
RCT2_ERROR("Invalid header in scenario scores file.");
RCT2_ERR("Invalid header in scenario scores file.");
return 0;
}
gScenarioListCount = header.scenario_count;
@ -210,7 +210,7 @@ int scenario_scores_save()
file = fopen(get_file_path(PATH_ID_SCORES), "wb");
if (file == NULL) {
RCT2_ERROR("Unable to save scenario scores.");
RCT2_ERR("Unable to save scenario scores.");
return 0;
}

View File

@ -180,7 +180,11 @@ static void window_map_close()
{
rct_window *w;
#ifdef _MSC_VER
__asm mov w, esi
#else
__asm__ ( "mov %[w], esi " : [w] "+m" (w) );
#endif
rct2_free(RCT2_GLOBAL(RCT2_ADDRESS_MAP_IMAGE_DATA, uint32*));
if ((RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3)) &&