7 |
|
#ifndef _common_h_ |
8 |
|
#define _common_h_ |
9 |
|
|
10 |
< |
#ifndef __FreeBSD__ |
10 |
> |
#ifdef linux |
11 |
> |
#undef linux |
12 |
> |
#endif |
13 |
> |
|
14 |
> |
#if !defined(__FreeBSD__) && !defined(__sun__) && !defined(__APPLE__) |
15 |
> |
#ifndef _BSD_SOURCE |
16 |
|
#define _BSD_SOURCE |
17 |
+ |
#endif |
18 |
+ |
#ifndef _POSIX_SOURCE |
19 |
|
#define _POSIX_SOURCE |
20 |
+ |
#endif |
21 |
+ |
#ifndef _GNU_SOURCE |
22 |
|
#define _GNU_SOURCE |
23 |
|
#endif |
24 |
+ |
#elif defined(__sun__) |
25 |
+ |
#define __EXTENSIONS__ |
26 |
+ |
#endif |
27 |
|
|
28 |
|
#include <pwd.h> |
29 |
|
#include <regex.h> |
64 |
|
void get(const char *prompt, regex_t *regex, char **string, jmp_buf environment); |
65 |
|
void setshells(Shells *shells, jmp_buf environment); |
66 |
|
|
67 |
< |
#ifndef __FreeBSD__ |
67 |
> |
#if !defined(__FreeBSD__) && !defined(__sun__) && !defined(__APPLE__) |
68 |
|
size_t strlcpy(char *dst, const char *src, size_t size); |
69 |
|
size_t strlcat(char *dst, const char *src, size_t size); |
70 |
|
char *fgetln(FILE * restrict stream, size_t * restrict len); |
71 |
+ |
#elif defined(__sun__) |
72 |
+ |
char *fgetln(FILE * restrict stream, size_t * restrict len); |
73 |
+ |
int setenv(const char *name, const char *value, int overwrite); |
74 |
|
#endif |
75 |
|
|
76 |
|
#endif//_common_h_ |