Menu

#183 __BORLANDC__, Pixels.h, IMTRAITS

open
nobody
None
5
2006-08-14
2006-08-14
vortic
No

Operating System: XP SP2
System RAM: not much
System CPU: an older one
Hard Drive Size: very small
Computer Make or Vendor: generic
What caused the bug: developer
Bug Severity: not noticeable unless fixed
Email address: vortic@sourceforge.net

Compiler/IDE: vc8, VC++2005 Express

In Pixels.h, lines 424-432, the great highlighting
features of the VC++2005 Express IDE indicate that the
code in the if clause, and not the else clause is "active":

#if (__BORLANDC__ < 0x0560) || (__BORLANDC__ >= 0x0580)
# define IMTRAITS SysPixelType::Traits
# define SysPixelTypeTraits SysPixelType::Traits
# define GrayPixelTypeTraits SysGrayscalePixelType::Traits
#else
# define IMTRAITS ImageBits::Traits
# define SysPixelTypeTraits SysPixelType::Traits
# define GrayPixelTypeTraits SysGrayscalePixelType::Traits
#endif

Evidently, we need to check first if __BORLANDC__ is
defined. Oddly, with the code in the if clause active,
everything compiles/build fine. If I check for
__BORLANDC__ being defined, the code in the else clause
is active (as expected), but I get compile errors in
AbstractImage.cpp

//modified code
#if defined(__BORLANDC__) && ((__BORLANDC__ < 0x0560)
|| (__BORLANDC__ >= 0x0580))
# define IMTRAITS SysPixelType::Traits
# define SysPixelTypeTraits SysPixelType::Traits
# define GrayPixelTypeTraits SysGrayscalePixelType::Traits
#else
# define IMTRAITS ImageBits::Traits
# define SysPixelTypeTraits SysPixelType::Traits
# define GrayPixelTypeTraits SysGrayscalePixelType::Traits
#endif

Error Messages:
AbstractImage.cpp
c:\dev\vcfdev\vcf\src\vcf\graphicskit\abstractimage.cpp(107)
error C2027: use of undefined type 'VCF::ImageBits'
c:\dev\vcfdev\vcf\src\vcf\graphicskit\image.h(24) : see
declaration of 'VCF::ImageBits'
c:\dev\vcfdev\vcf\src\vcf\graphicskit\abstractimage.cpp(107)
error C3861: 'getImageType': identifier not found
c:\dev\vcfdev\vcf\src\vcf\graphicskit\abstractimage.cpp(113)
error C2027: use of undefined type 'VCF::ImageBits'
c:\dev\vcfdev\vcf\src\vcf\graphicskit\image.h(24) : see
declaration of 'VCF::ImageBits'
c:\dev\vcfdev\vcf\src\vcf\graphicskit\abstractimage.cpp(113)
error C2660: 'VCF::AbstractImage::getChannelSize' :
function does not take 1 arguments
c:\dev\vcfdev\vcf\src\vcf\graphicskit\abstractimage.cpp(118)
error C2027: use of undefined type 'VCF::ImageBits'
c:\dev\vcfdev\vcf\src\vcf\graphicskit\image.h(24) : see
declaration of 'VCF::ImageBits'
c:\dev\vcfdev\vcf\src\vcf\graphicskit\abstractimage.cpp(118)
error C2660: 'VCF::AbstractImage::getChannelType' :
function does not take 1 arguments
c:\dev\vcfdev\vcf\src\vcf\graphicskit\abstractimage.cpp(123)
error C2027: use of undefined type 'VCF::ImageBits'
c:\dev\vcfdev\vcf\src\vcf\graphicskit\image.h(24) : see
declaration of 'VCF::ImageBits'
c:\dev\vcfdev\vcf\src\vcf\graphicskit\abstractimage.cpp(123)
error C2660:
'VCF::AbstractImage::getPixelLayoutOrder' : function
does not take 1 arguments

I'm not sure what VS6 and vc7/7.1 is doing with this,
so I'll let you decide.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB