Ticket #44004: patch-gethostname.c.diff

File patch-gethostname.c.diff, 673 bytes (added by Gminfly, 10 years ago)

gethostname.c patch goes in 'files' folder of port dir

  • gethostname.c

    old new  
    1818#include <arpa/inet.h>
    1919#include <string.h>
    2020
     21#ifndef strlcpy
     22/*
     23 * On OS X (and probably some other systems aswell), strlcpy might be
     24 * implemented as a macro. If this macro is defined while we're including this
     25 * header, strlcpy is already declared and trying to re-declare it with the
     26 * following line *will* fail, because the macro will expand to something
     27 * that's not a valid function name.
     28 */
    2129size_t strlcpy(char *dst, const char *src, size_t siz);
     30#endif /* !defined(strlcpy) */
    2231
    2332char *get_hostname(char* addr)
    2433{