I have a header file which contains
#define PROTOTYPE(s) s
What is the point of that? Seems like it would just replace the input with itself.
There are TONS of other directives around it, but the only one that appears to have any bearing just checked if it's defined: #ifndef PROTOTYPE
. I found some places in HDF4 header files that do this: #define PROTOTYPE
. So, none of that really clear up my question. Still seems pretty useless.
Here's how it's used:
CS_RETCODE clientmsg_callback PROTOTYPE((
CS_CONTEXT * context,
CS_CONNECTION *connection,
CS_CLIENTMSG *clientmsg));
This is part of a project which uses Sybase Open Client. clientmsg_callback is later used here:
ct_callback(context, NULL, CS_SET, CS_CLIENTMSG_CB,
(CS_VOID *)clientmsg_callback);
I'm going off of a sample program from here:
clientmsg_callback is implemented later. I think the sample was originally written with C in mind, instead of C++. Perhaps that has something to do with it?
#if
/#ifdef
/#ifndef
/#else
directives where it might have a different definition instead? It could make a difference when used in other macros, especially near#
or##
. It could be just for a commenting style. Not enough context to really answer.PROTOTYPE
. If you see weird defines in code that seem useless, think about potential flexibility if someone wanted to change something conveniently.