From aa0d39dfe492e7fd10b0d6fc6c91acf28d5ae1fd Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Mon, 2 Oct 2023 18:16:17 -0400 Subject: [PATCH] Fix the moving truck leaving behind IO_ERROR and friends --- common/CMakeLists.txt | 1 - common/swig/kicad.i | 7 ++++--- include/ki_exception.h | 9 +++++---- plugins/3d/vrml/CMakeLists.txt | 1 - 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index f99c23b1e8..741bb50a14 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -432,7 +432,6 @@ set( COMMON_SRCS eda_tools.cpp env_paths.cpp env_vars.cpp - exceptions.cpp executable_names.cpp filename_resolver.cpp file_history.cpp diff --git a/common/swig/kicad.i b/common/swig/kicad.i index 8c947cfd7f..41907f77c7 100644 --- a/common/swig/kicad.i +++ b/common/swig/kicad.i @@ -37,6 +37,10 @@ %include %include +// SWIG is awful and cant just ignore declspec +#define KICOMMON_API +#define GAL_API + %include "ki_exception.i" // affects all that follow it /* @@ -118,9 +122,6 @@ principle should be easily implemented by adapting the current STL containers. // TODO: wrapper of BASE_SET (see std::bitset BASE_SET;) -#define KICOMMON_API -#define GAL_API - // header files that must be wrapped %include diff --git a/include/ki_exception.h b/include/ki_exception.h index b8adca22cf..45e259395d 100644 --- a/include/ki_exception.h +++ b/include/ki_exception.h @@ -25,6 +25,7 @@ #ifndef KI_EXCEPTION_H_ #define KI_EXCEPTION_H_ +#include #include @@ -41,7 +42,7 @@ * Hold a translatable error message and may be used when throwing exceptions containing a * translated error message. */ -class KI_PARAM_ERROR // similar to std::invalid_argument for instance +class KICOMMON_API KI_PARAM_ERROR // similar to std::invalid_argument for instance { public: /** @@ -72,7 +73,7 @@ private: * * @author Dick Hollenbeck */ -class IO_ERROR // : std::exception +class KICOMMON_API IO_ERROR // : std::exception { public: /** @@ -115,7 +116,7 @@ protected: * * @author Dick Hollenbeck */ -struct PARSE_ERROR : public IO_ERROR +struct KICOMMON_API PARSE_ERROR : public IO_ERROR { int lineNumber; ///< at which line number, 1 based index. int byteIndex; ///< at which byte offset within the line, 1 based index @@ -171,7 +172,7 @@ protected: * by a file generated by a newer version of KiCad than this. This can be used to generate * more informative error messages. */ -struct FUTURE_FORMAT_ERROR : public PARSE_ERROR +struct KICOMMON_API FUTURE_FORMAT_ERROR : public PARSE_ERROR { wxString requiredVersion; ///< version or date of KiCad required to open file diff --git a/plugins/3d/vrml/CMakeLists.txt b/plugins/3d/vrml/CMakeLists.txt index 7a18368254..fc57156d48 100644 --- a/plugins/3d/vrml/CMakeLists.txt +++ b/plugins/3d/vrml/CMakeLists.txt @@ -24,7 +24,6 @@ include_directories( # add_library( s3d_plugin_vrml MODULE - ${CMAKE_SOURCE_DIR}/common/exceptions.cpp vrml.cpp x3d.cpp wrlproc.cpp