Skip to content

Commit

Permalink
Remove MFC defines from windows.cfg (#5959)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Feb 8, 2024
1 parent 6ee2c86 commit b3bb172
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 19 deletions.
8 changes: 0 additions & 8 deletions cfg/windows.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7010,14 +7010,6 @@ HFONT CreateFont(
<define name="afx_msg" value=""/>
<define name="AFX_EXT_CLASS" value=""/>
<define name="DEBUG_NEW" value="new"/>
<define name="DECLARE_MESSAGE_MAP()" value=""/>
<define name="DECLARE_DYNAMIC(x)" value=""/>
<define name="DECLARE_DYNAMIC_CLASS(x)" value=""/>
<define name="DECLARE_DYNCREATE(x)" value=""/>
<define name="DECLARE_SERIAL(x)" value=""/>
<define name="IMPLEMENT_DYNAMIC(name,base)" value=""/>
<define name="IMPLEMENT_DYNCREATE(name,base)" value=""/>
<define name="IMPLEMENT_SERIAL(name,base,schema)" value=""/>
<define name="INVALID_HANDLE_VALUE" value="0"/>
<define name="INVALID_SOCKET" value="0"/>
<define name="WINAPI" value="__stdcall"/>
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ if (BUILD_TESTS)
add_cfg(libcurl.c)
add_cfg(libsigc++.cpp)
add_cfg(lua.c)
add_cfg(mfc.cpp)
add_cfg(opencv2.cpp)
add_cfg(openmp.c)
add_cfg(openssl.c)
Expand Down
16 changes: 16 additions & 0 deletions test/cfg/mfc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

// Test library configuration for mfc.cfg

#include <afxwin.h>


class MyClass : public CObject {
DECLARE_DYNAMIC(MyClass)
DECLARE_DYNCREATE(MyClass)
DECLARE_SERIAL(MyClass)
public:
MyClass() {}
};
IMPLEMENT_DYNAMIC(MyClass, CObject)
IMPLEMENT_DYNCREATE(MyClass, CObject)
IMPLEMENT_SERIAL(MyClass,CObject, 42)
10 changes: 10 additions & 0 deletions test/cfg/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ function windows_fn {
true
}

# mfc.cpp
function mfc_fn {
# TODO: Add syntax check
true
}

# wxwidgets.cpp
function wxwidgets_fn {
# TODO: get rid of the error enabling/disabling?
Expand Down Expand Up @@ -480,6 +486,10 @@ function check_file {
lua_fn
${CPPCHECK} ${CPPCHECK_OPT} --library=$lib ${DIR}$f
;;
mfc.cpp)
mfc_fn
${CPPCHECK} ${CPPCHECK_OPT} --platform=win64 --library=$lib ${DIR}$f
;;
opencv2.cpp)
# TODO: "opencv.pc" is not commonly available in distros
#opencv2_fn
Expand Down
11 changes: 0 additions & 11 deletions test/cfg/windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1144,17 +1144,6 @@ void GetShortPathName_validCode(const TCHAR* lpszPath)
delete[] buffer;
}

class MyClass : public CObject {
DECLARE_DYNAMIC(MyClass)
DECLARE_DYNCREATE(MyClass)
DECLARE_SERIAL(MyClass)
public:
MyClass() {}
};
IMPLEMENT_DYNAMIC(MyClass, CObject)
IMPLEMENT_DYNCREATE(MyClass, CObject)
IMPLEMENT_SERIAL(MyClass,CObject, 42)

void invalidPrintfArgType_StructMember(double d) { // #9672
typedef struct { CString st; } my_struct_t;

Expand Down
4 changes: 4 additions & 0 deletions test/testlibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,10 @@ class TestLibrary : public TestFixture {
const Settings s = settingsBuilder().library("std.cfg").library("microsoft_sal.cfg").build();
ASSERT_EQUALS(s.library.defines.empty(), false);
}
{
const Settings s = settingsBuilder().library("std.cfg").library("windows.cfg").library("mfc.cfg").build();
ASSERT_EQUALS(s.library.defines.empty(), false);
}
}
};

Expand Down

0 comments on commit b3bb172

Please sign in to comment.