From 98a5e6ce16f8c0adfc704cff877f0e1fb9ab1cf0 Mon Sep 17 00:00:00 2001 From: Sylae Jiendra Corell Date: Wed, 30 Jul 2014 13:15:50 -0600 Subject: [PATCH] Tell the compiler which max() and min() to use This fixes an error with the build server's version of mingw that was not finding max() or min() --- Win32/scenedit/Makefile | 2 +- Win32/scenedit/dlogtool.cpp | 9 +++++---- Win32/scenedit/tactions.cpp | 9 +++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Win32/scenedit/Makefile b/Win32/scenedit/Makefile index b05f456b..ec11f1d2 100644 --- a/Win32/scenedit/Makefile +++ b/Win32/scenedit/Makefile @@ -6,7 +6,7 @@ WINDRES = $(PREFIX)windres RES = Blades_of_Exile_Scenario_Editor_private.res OBJ = buttonmg.o dlogtool.o global.o graphutl.o keydlgs.o tfileio.o townout.o edsound.o graphics.o scenario.o blscened.o tactions.o $(RES) LINKOBJ = buttonmg.o dlogtool.o global.o graphutl.o keydlgs.o tfileio.o townout.o edsound.o graphics.o scenario.o blscened.o tactions.o $(RES) -LIBS = -mwindows -lwinmm --strip-all -static-libgcc -static-libstdc++ +LIBS = -mwindows -lwinmm -static-libgcc -static-libstdc++ INCS = -I"include" CXXINCS = BIN = "Blades of Exile Scenario Editor.exe" diff --git a/Win32/scenedit/dlogtool.cpp b/Win32/scenedit/dlogtool.cpp index 7a6463f9..cac10850 100644 --- a/Win32/scenedit/dlogtool.cpp +++ b/Win32/scenedit/dlogtool.cpp @@ -1,5 +1,6 @@ #include +#include #define ND 15 #define NI 500 @@ -494,12 +495,12 @@ BOOL CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wParam, LPARAM edit_box[l] = CreateWindow("edit",NULL,WS_CHILD | WS_BORDER | WS_VISIBLE | ES_AUTOVSCROLL, item_rect[free_item].left,item_rect[free_item].top, item_rect[free_item].right - item_rect[free_item].left, - max(22,item_rect[free_item].bottom - item_rect[free_item].top), + std::max(22,item_rect[free_item].bottom - item_rect[free_item].top), dlgs[free_slot],(HMENU)150,store_hInstance,NULL); else edit_box[l] = CreateWindow("edit",NULL,WS_CHILD | WS_BORDER | WS_VISIBLE | ES_MULTILINE | ES_AUTOVSCROLL, item_rect[free_item].left,item_rect[free_item].top, item_rect[free_item].right - item_rect[free_item].left, - max(22,item_rect[free_item].bottom - item_rect[free_item].top), + std::max(22,item_rect[free_item].bottom - item_rect[free_item].top), dlgs[free_slot],(HMENU)150,store_hInstance,NULL); num_text_boxes++; store_edit_parent[l] = dlgs[free_slot]; @@ -516,8 +517,8 @@ BOOL CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wParam, LPARAM } break; } - win_height = max(win_height, item_rect[free_item].bottom + 28); - win_width = max(win_width, item_rect[free_item].right + 11); + win_height = std::max(win_height, item_rect[free_item].bottom + 28); + win_width = std::max(win_width, item_rect[free_item].right + 11); } diff --git a/Win32/scenedit/tactions.cpp b/Win32/scenedit/tactions.cpp index 6f0b55d5..d5f7ccb8 100644 --- a/Win32/scenedit/tactions.cpp +++ b/Win32/scenedit/tactions.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -1509,8 +1510,8 @@ Boolean handle_keystroke(WPARAM wParam, LPARAM lParam) } if (store_ter != current_terrain_type) draw_terrain(); - mouse_button_held = FALSE; - + mouse_button_held = FALSE; + return are_done; } @@ -1540,8 +1541,8 @@ Boolean where_lit[64][64]; l.x = i; l.y = j; rad = scenario.ter_types[t_d.terrain[i][j]].light_radius; if (rad > 0) { - for (where.x = max(0,i - rad); where.x < min(max_dim[town_type],i + rad + 1); where.x++) - for (where.y = max(0,j - rad); where.y < min(max_dim[town_type],j + rad + 1); where.y++) + for (where.x = std::max(0,i - rad); where.x < std::min(max_dim[town_type],i + rad + 1); where.x++) + for (where.y = std::max(0,j - rad); where.y < std::min(max_dim[town_type],j + rad + 1); where.y++) if ((where_lit[where.x][where.y] == 0) && (dist(where,l) <= rad) && (can_see(l,where,0) < 5)) where_lit[where.x][where.y] = 1; }