Re:

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Mon, 22 Sep 2008 09:38:32 -0500


Hi Anton,

CINT does support #pragma pack in interpreted code. So to use custom alignment you will need to simply compile and generate a dictionary for
you class, which is trivial using ACLiC. Using the header file below the signature simply do

   root [] .L check.h+

you can then use WAVEDESC in any interpreted code and it will have the correct alignment.

Cheers,
Philippe

// Check.h

#pragma pack(push, 1)

struct WAVEDESC {
  char DESCRIPTOR_NAME[16];
  char TEMPLATE_NAME[16];
  short COMM_TYPE;
  short COMM_ORDER;
};

#pragma pack(pop)

// End of check.h

Anton Korneev wrote:
> Hello,
>
> how can I define the way of packing/aligning of members of struct in
> CINT? The usual
>
> #pragma pack(push, 1)
> ...
> #pragma pack(pop)
>
> don't work in CINT - see attached macro.
> Under CINT it gives:
>
> root [] .x check.cc
> 40
>
> and under g++:
>
> $ g++ check.cc -o check.exe
> $ ./check.exe
> 36
>
>
>
Received on Mon Sep 22 2008 - 16:38:48 CEST

This archive was generated by hypermail 2.2.0 : Mon Sep 22 2008 - 23:50:02 CEST