c++ - pragma problem
- mikaelh delphi.se (59/59) Jul 15 2002 Hi,
- Walter (3/11) Jul 15 2002 What alignment are you setting it to?
- mikaelh delphi.se (4/5) Jul 15 2002 Sorry, I'm all lost now. I have never using these options before.
- Walter (4/10) Jul 15 2002 The #pragma pack is used to set the alignment within the source code. Yo...
- mikaelh delphi.se (3/6) Jul 15 2002 If i undestand the help file right it must be 1 in this line below?
- Christof Meerwald (11/14) Jul 15 2002 I guess DM doesn't correctly understand the "Visual C++" extensions of t...
- Walter (8/17) Jul 15 2002 Your
Hi, When i try to compile "Developer's Image Library" (http://www.imagelib.org) i get stuck on this define statements (and similar ones). Error message is "alignment must be a power of 2" and a warning "unrecognized pragma" #ifdef _WIN32 #pragma pack(push, bmp_struct, 1) #endif typedef struct BMPHEAD { ILushort bfType; ILint bfSize; ILuint bfReserved; ILint bfDataOff; ILint biSize; ILint biWidth; ILint biHeight; ILshort biPlanes; ILshort biBitCount; ILint biCompression; ILint biSizeImage; ILint biXPelsPerMeter; ILint biYPelsPerMeter; ILint biClrUsed; ILint biClrImportant; } IL_PACKSTRUCT BMPHEAD; typedef struct OS2_HEAD { // Bitmap file header. ILushort bfType; ILuint biSize; ILshort xHotspot; ILshort yHotspot; ILuint DataOff; // Bitmap info header. ILuint cbFix; ILuint cx; ILuint cy; ILushort cPlanes; ILushort cBitCount; /*ILuint ulCompression; ILuint cbImage; ILuint cxResolution; ILuint cyResolution; ILuint cclrUsed; ILuint cclrImportant; ILushort usUnits; ILushort usReserved; ILushort usRecording; ILushort usRendering; ILuint cSize1; ILuint cSize2; ILuint ulColorEncoding; ILuint ulIdentifier;*/ } IL_PACKSTRUCT OS2_HEAD; #ifdef _WIN32 #pragma pack(pop, bmp_struct) #endif /Mikael
Jul 15 2002
<mikaelh delphi.se> wrote in message news:aguh0h$1n74$1 digitaldaemon.com...Hi, When i try to compile "Developer's Image Library"(http://www.imagelib.org)i get stuck on this define statements (and similar ones). Error message is "alignment must be a power of 2" and a warning "unrecognized pragma" #ifdef _WIN32 #pragma pack(push, bmp_struct, 1) #endifWhat alignment are you setting it to?
Jul 15 2002
What alignment are you setting it to?Sorry, I'm all lost now. I have never using these options before. But I found something under Settings/Build/Struct Alignment which are set to quad word, and tested all other options but it gave not better results.
Jul 15 2002
<mikaelh delphi.se> wrote in message news:agutk0$25at$1 digitaldaemon.com...The #pragma pack is used to set the alignment within the source code. Your code passes it a macro or something, what value does that expand to? (The value needs to be a power of 2.)What alignment are you setting it to?Sorry, I'm all lost now. I have never using these options before. But I found something under Settings/Build/Struct Alignment which are set to quad word, and tested all other options but it gave not better results.
Jul 15 2002
The #pragma pack is used to set the alignment within the source code. Your code passes it a macro or something, what value does that expand to? (The value needs to be a power of 2.)If i undestand the help file right it must be 1 in this line below? #pragma pack(push, bmp_struct, 1) I tried them all (2,4,8,16)
Jul 15 2002
On Mon, 15 Jul 2002 10:46:25 -0700, Walter wrote: [ #pragma pack(push, bmp_struct, 1) ]The #pragma pack is used to set the alignment within the source code. Your code passes it a macro or something, what value does that expand to? (The value needs to be a power of 2.)I guess DM doesn't correctly understand the "Visual C++" extensions of the pack pragma. "bmp_struct" is an identifier for the "pragma pack" stack and the alignment is 1. (see http://msdn.microsoft.com/library/en-us/vclang/html/_PREDIR_pack.asp) bye, Christof -- http://cmeerw.org JID: cmeerw jabber.at mailto cmeerw at web.de ...and what have you contributed to the Net?
Jul 15 2002
"Christof Meerwald" <cmeerw web.de> wrote in message news:agv657$2drp$1 digitaldaemon.com...On Mon, 15 Jul 2002 10:46:25 -0700, Walter wrote: [ #pragma pack(push, bmp_struct, 1) ]YourThe #pragma pack is used to set the alignment within the source code.(Thecode passes it a macro or something, what value does that expand to?Thanks for the reference. More accurately, MS changed it from what it was before. In any case, replacing it with: #pragma pack(push, 1) should work.value needs to be a power of 2.)I guess DM doesn't correctly understand the "Visual C++" extensions of the pack pragma. "bmp_struct" is an identifier for the "pragma pack" stack and the alignment is 1. (see http://msdn.microsoft.com/library/en-us/vclang/html/_PREDIR_pack.asp)
Jul 15 2002