Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is __USE_MISC macro used for?

Tags:

c

glibc

I am working on a project and the code contains a macro definition:

#define __USE_MISC

The code is not using it so I think it has some other purpose.

like image 901
Bruce Avatar asked Apr 19 '12 15:04

Bruce


1 Answers

__USE_MISC is defined in /usr/include/features.h on the condition:

#if defined _BSD_SOURCE || defined _SVID_SOURCE
# define __USE_MISC     1
#endif

__USE_MISC --> Define things common to BSD and System V Unix.

So it looks like your code wants to ensure that it's defined in any case even if both _BSD_SOURCE and _SVID_SOURCE are not defined (Since glibc 2.20, defining _DEFAULT_SOURCE enables __USE_MISC).

See feature test macros for more information.

like image 125
P.P Avatar answered Sep 20 '22 15:09

P.P