Skip to content

Commit

Permalink
fix forward declaration of imgui ImVec2 (#73724)
Browse files Browse the repository at this point in the history
imgui declares ImVec2 as a struct, and some compilers may warn about the
different declaration.

fixes:

	ccache clang++ -Isrc/libcataclysm.a.p -Isrc -I../src -Isrc/third-party -I../src/third-party -Isrc/third-party/imgui -I../src/third-party/imgui -I/usr/include/ncursesw -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++17 -O3 -DIMTUI -fPIC -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -Werror -Wall -Wextra -Wmissing-declarations -Wmissing-noreturn -Wnon-virtual-dtor -Woverloaded-virtual -Wpedantic -Wsuggest-override -Wunused-macros -Wzero-as-null-pointer-constant -Wno-unknown-warning-option -Wno-c++20-compat -fsigned-char -MD -MQ src/libcataclysm.a.p/cata_imgui.cpp.o -MF src/libcataclysm.a.p/cata_imgui.cpp.o.d -o src/libcataclysm.a.p/cata_imgui.cpp.o -c ../src/cata_imgui.cpp
	In file included from ../src/cata_imgui.cpp:6:
	../src/third-party/imgui/imgui.h:258:1: error: 'ImVec2' defined as a struct here but previously declared as a class; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Werror,-Wmismatched-tags]
	  258 | struct ImVec2
	      | ^
	../src/cata_imgui.h:17:1: note: did you mean struct here?
	   17 | class ImVec2;
	      | ^~~~~
	      | struct
	1 error generated.
  • Loading branch information
mischief committed May 12, 2024
1 parent 39e2afa commit fe9e803
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cata_imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct input_event;
#endif

struct point;
class ImVec2;
struct ImVec2;
class Font;
class input_context;

Expand Down

0 comments on commit fe9e803

Please sign in to comment.