diff options
Diffstat (limited to 'mDNSResponder/mDNSShared/dnssd_clientlib.c')
-rw-r--r-- | mDNSResponder/mDNSShared/dnssd_clientlib.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/mDNSResponder/mDNSShared/dnssd_clientlib.c b/mDNSResponder/mDNSShared/dnssd_clientlib.c index cfc1d424..2a1f5ed4 100644 --- a/mDNSResponder/mDNSShared/dnssd_clientlib.c +++ b/mDNSResponder/mDNSShared/dnssd_clientlib.c @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 4 -*- * - * Copyright (c) 2004-2011 Apple Inc. All rights reserved. + * Copyright (c) 2004-2018 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -31,10 +31,6 @@ #include "dns_sd.h" -#if MDNS_BUILDINGSHAREDLIBRARY || MDNS_BUILDINGSTUBLIBRARY -#pragma export on -#endif - #if defined(_WIN32) // disable warning "conversion from <data> to uint16_t" #pragma warning(disable:4244) @@ -361,6 +357,14 @@ DNSServiceErrorType DNSSD_API TXTRecordGetItemAtIndex #define STRINGIFY_ARGUMENT_WITHOUT_EXPANSION(s) # s #define STRINGIFY(s) STRINGIFY_ARGUMENT_WITHOUT_EXPANSION(s) +// The "used" variable attribute prevents a non-exported variable from being stripped, even if its visibility is hidden, +// e.g., when compiling with -fvisibility=hidden. +#if defined(__GNUC__) +#define DNSSD_USED __attribute__((used)) +#else +#define DNSSD_USED +#endif + // NOT static -- otherwise the compiler may optimize it out // The "@(#) " pattern is a special prefix the "what" command looks for -const char VersionString_SCCS_libdnssd[] = "@(#) libdns_sd " STRINGIFY(mDNSResponderVersion) " (" __DATE__ " " __TIME__ ")"; +const char VersionString_SCCS_libdnssd[] DNSSD_USED = "@(#) libdns_sd " STRINGIFY(mDNSResponderVersion) " (" __DATE__ " " __TIME__ ")"; |