Hi,everyone: I want to port mad to windows(VC++).The follwoing statement will be a syntax error in VC++.
# define PTR(offs, bits) { ptr: { 0, bits, offs } } (huffman.c)
What's the meaning of this statement ,what's the meaning of "ptr:" ? How can I change it in VC++?
Many many thanks.
Hi,
I want to port mad to windows(VC++).The follwoing statement will be a
syntax error in VC++.
# define PTR(offs, bits) { ptr: { 0, bits, offs } } (huffman.c)
What's the meaning of this statement ,what's the meaning of "ptr:" ? How can I change it in VC++?
This is a GNU extension that enables initialization of the `union huffquad' data structure using a member other than the first. In the example above, it means the data should initialize the "ptr" member of the union, not the "value" member (which would be the default.) See huffman.h for the definition of the union.
The C programming language unfortunately lacks a way to do this otherwise, although you might have some luck tricking the compiler by formatting the data always to look like the first member.
I have tried to find a similar extension in VC++ to do the same thing, but there doesn't appear to be one.
It might be nice to reformat all of the Huffman tables into something not requiring this extension, but so far I've not been happy with the alternatives...
-rob