LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting the byte alignment at the project level

Is there a way to set the byte alignment at the project level, for example a project setting.  I see the __DEFALIGN macro in the predefined macros which changes based on the compatibility mode I select but how do I change that default setting
0 Kudos
Message 1 of 2
(2,932 Views)
Look at the #pragma pack directive, described  in the LabWindows/CVI Programmer Reference Manual.

Here is an excerpt from the chapter titled Compiler/Linker Issues:

Structure Packing

...

example:

 

#pragma pack (4) /* set maximum alignment to 4 */

typedef struct {

char a;

int b;

} MyStruct1;

typedef struct {

char a;

double b;

} MyStruct2;

#pragma pack () /* reset max alignment to default */

 

LabWindows/CVI predefines the __DEFALIGN macro to the default structure alignment of

the current compatible compiler.

 

0 Kudos
Message 2 of 2
(2,921 Views)