|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++.beta - [bug] dmc.8.48.3 extern "C" and class member-functions
Looks like bug: extern "C" is applied to class member-functions.
This code compiled without error with previous DMC (8.41.5n) and was
taken from MS DX8 SDK (dxtrans.h)
If this is proper behavior (according to standards), I would like to
hear suggestions how to work around this.
Nic Tiger
dmc -c dx.cpp >1
------------------
DXBASESAMPLE(const DWORD val) { *this = (*(DXBASESAMPLE *)&val); }
^
dx.cpp(19) : Error: '?0' is already defined
operator DWORD () const {return *((DWORD *)this); }
^
dx.cpp(20) : Error: '?0' is already defined
--- errorlevel 1
------------------
extern "C"{
typedef unsigned long DWORD;
typedef unsigned char BYTE;
class DXBASESAMPLE
{
public:
BYTE Blue;
BYTE Green;
BYTE Red;
BYTE Alpha;
DXBASESAMPLE() {}
DXBASESAMPLE(const BYTE alpha, const BYTE red, const BYTE green,
const BYTE blue) :
Alpha(alpha),
Red(red),
Green(green),
Blue(blue) {}
DXBASESAMPLE(const DWORD val) { *this = (*(DXBASESAMPLE *)&val); }
operator DWORD () const {return *((DWORD *)this); }
DWORD operator=(const DWORD val) { return *this = *((DXBASESAMPLE
*)&val); }
}; // DXBASESAMPLE
}
Apr 14 2006
Nic Tiger wrote:Looks like bug: extern "C" is applied to class member-functions. This code compiled without error with previous DMC (8.41.5n) and was taken from MS DX8 SDK (dxtrans.h) Apr 14 2006
Walter Bright wrote:Nic Tiger wrote:Looks like bug: extern "C" is applied to class member-functions. This code compiled without error with previous DMC (8.41.5n) and was taken from MS DX8 SDK (dxtrans.h) Apr 14 2006
|