WTF is this?

P

Psymaster

extern unzFile ZEXPORT unzOpen OF((const char *path));


What is this mess? It's from the zlib source.
 
V

Victor Bazarov

Psymaster said:
extern unzFile ZEXPORT unzOpen OF((const char *path));


What is this mess? It's from the zlib source.

How the F should we know? Search the headers.

If I had to guess, the 'ZEXPORT' is a macro expanding into
some kind of compiler-specific nonsense like "__dllexport"
and 'OF' is a macro expanding into a function declaration
(or only the parameter list). 'unzFile' can be the return
value type, and 'unzOpen' is the actual name of the function
(if 'OF' is the function header without the name).

Victor
 
M

Medi Montaseri

Victor Bazarov said:
How the F should we know? Search the headers.

If I had to guess, the 'ZEXPORT' is a macro expanding into
some kind of compiler-specific nonsense like "__dllexport"
and 'OF' is a macro expanding into a function declaration
(or only the parameter list). 'unzFile' can be the return
value type, and 'unzOpen' is the actual name of the function
(if 'OF' is the function header without the name).

Victor

Run the source code thru the CPP and see what you get. gcc -E could do that as well.
 
P

Psymaster

The latter is used with older versions of C compiler
(K&R), which don't expect to see parameter list in function
prototypes.

Thanks a lot for the reply, it seems everything is what you
guessed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top