mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 12:19:54 -05:00
607d9cf561
The pattern `extern "C" { inline bool operator==(...) {} }` appears
in at least one Windows SDK header, `winnt.h`. Translation units that
instantiate the inline symbol produce object files with a symbol named
just `==`. Avoid exporting such symbols because the linker will not
recognize them.
Fixes: #24999
54 lines
805 B
C++
54 lines
805 B
C++
#include "hello.h"
|
|
|
|
#include <stdio.h>
|
|
int Hello::Data = 0;
|
|
void Hello::real()
|
|
{
|
|
return;
|
|
}
|
|
void hello()
|
|
{
|
|
printf("hello");
|
|
}
|
|
void Hello::operator delete[](void*) {};
|
|
void Hello::operator delete(void*) {};
|
|
|
|
#ifdef HELLO_VFTABLE
|
|
HelloVFTable::HelloVFTable()
|
|
{
|
|
}
|
|
HelloVFTable::~HelloVFTable()
|
|
{
|
|
}
|
|
#endif
|
|
|
|
#ifndef __SUNPRO_CC
|
|
// C++ operators incorrectly declared extern "C" should *not* be exported.
|
|
extern "C" {
|
|
bool operator==(Hello const&, Hello const&)
|
|
{
|
|
return false;
|
|
}
|
|
bool operator!=(Hello const&, Hello const&)
|
|
{
|
|
return false;
|
|
}
|
|
bool operator<(Hello const&, Hello const&)
|
|
{
|
|
return false;
|
|
}
|
|
bool operator<=(Hello const&, Hello const&)
|
|
{
|
|
return false;
|
|
}
|
|
bool operator>(Hello const&, Hello const&)
|
|
{
|
|
return false;
|
|
}
|
|
bool operator>=(Hello const&, Hello const&)
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
#endif
|