Commits
Frank Schima authored 90c559033c9
1 + | --- gethostname.c.orig 2014-05-29 13:20:06.000000000 -0400 |
2 + | +++ gethostname.c 2014-05-29 13:19:42.000000000 -0400 |
3 + | |
4 + | #include <arpa/inet.h> |
5 + | #include <string.h> |
6 + | |
7 + | +#ifndef strlcpy |
8 + | +/* |
9 + | + * On OS X (and probably some other systems aswell), strlcpy might be |
10 + | + * implemented as a macro. If this macro is defined while we're including this |
11 + | + * header, strlcpy is already declared and trying to re-declare it with the |
12 + | + * following line *will* fail, because the macro will expand to something |
13 + | + * that's not a valid function name. |
14 + | + */ |
15 + | size_t strlcpy(char *dst, const char *src, size_t siz); |
16 + | +#endif /* !defined(strlcpy) */ |
17 + | |
18 + | char *get_hostname(char* addr) |
19 + | { |