I'm trying to refurbish some old code with lines like:
BYTE huge * _lpDIBHdr; // Pointer to BITMAPINFOHEADER
in it. How best to do that? Thank you.
I'm trying to refurbish some old code with lines like:
BYTE huge * _lpDIBHdr; // Pointer to BITMAPINFOHEADER
in it. How best to do that? Thank you.
This evidently was written to be 16-bit real-mode x86 code, where huge
was needed in order to have arrays larger than 64KB. See What are near, far and huge pointers?, and What conventions and language extensions did people use to program the 8086 and 80286? on Retrocomputing.SE.
If you are lucky, that's the only part of the code that's specific to x86-16, and it is otherwise portable standard C. In which case you can simply delete all instances of the huge
keyword, or insert #define huge /* nothing */
at the top of every source file. In a 32- or 64-bit compiler there is no such 64KB limit. You can treat near
and far
similarly.
If you are unlucky, then the code may contain lots of other instances non-portable x86-16-specific code, and then you have a long porting project ahead of you. This may include instances like huge
that are overt (program won't compile), or more subtle (program compiles but doesn't run correctly, or contains hard-to-find bugs).