Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of "char *_EXFUN(index,(const char *, int));"

Tags:

c

I found this as a proposition of the eclipse idexer/intelisence whatever the call it. And this is it:

char *_EXFUN(index,(const char *, int));

First it looks like a function returning a pointer for a char, but the parameters (if it is a function at all) looks to me quite confusing. How come into the parameter list we have a brackets.

like image 334
Hairi Avatar asked May 31 '16 12:05

Hairi


1 Answers

_EXFUN appears to be a macro used in standard headers on some platforms, e.g. here

#ifndef _EXFUN
# define _EXFUN(N,P) N P
#endif

Thus, char *_EXFUN(index,(const char *, int)); expands to

char * index(const char *, int)

This trick is sometimes done so that the same header can be preprocessed with _EXFUN set to something else, e.g. to introspect function signatures, or to declare exported symbols in a library.

like image 60
Kuba hasn't forgotten Monica Avatar answered Nov 14 '22 19:11

Kuba hasn't forgotten Monica