GCS  0.2.3
gu_system.h
1 // Copyright (C) 2013 Codership Oy <info@codership.com>
2 
9 #ifndef _gu_system_h_
10 #define _gu_system_h_
11 
12 #define _GNU_SOURCE // program_invocation_name, program_invocation_short_name
13 #include <errno.h>
14 
15 #include <stdlib.h> // getexecname, getprogname
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
20 
21 /* See: http://lists.gnu.org/archive/html/bug-gnulib/2010-12/txtrjMzutB7Em.txt
22  * for implementation of GU_SYS_PROGRAM_NAME on other platforms */
23 
24 #if defined(__sun__)
25 # define GU_SYS_PROGRAM_NAME getexecname ()
26 #elif defined(__APPLE__) || defined(__FreeBSD__)
27 # define GU_SYS_PROGRAM_NAME getprogname ()
28 #elif defined(__linux__)
29 # define GU_SYS_PROGRAM_NAME program_invocation_name
30 #endif
31 
32 #ifdef __cplusplus
33 }
34 #endif /* __cplusplus */
35 
36 #endif /* _gu_system_h_ */