From patchwork Wed Aug 12 21:14:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stan Shebs X-Patchwork-Id: 8169 Received: (qmail 101731 invoked by alias); 12 Aug 2015 21:15:02 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 101713 invoked by uid 89); 12 Aug 2015 21:15:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-io0-f181.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=QgMurswyyNb0KwUDZLTTVpCAOPMGC8rYpvH9+uRcMk8=; b=EF0PG7mT/T4LyOGwykQCjm60HHIPZLfJ7XiJKa8YV3bFzh7SxZyNC9JiEMCowpGigc kCBcj8EyAFi2UvBL3OldHxr6WO+3alh8qyJR9Y224oCn93i9MYQ+6n5nYzUS+qe9AVve HvnFQci672wTR+KQM5X8ACK8Rcp4mq7pdKcKkgO9VOgFPyLzeZtY9Y/L0pn3Wsa2UKLR Sz/99+P8W1EEppKL2FMHIrD7iU6aJg448wxsVSIcDb+OTFm6RVD6G3biuOaJ73LV3Nq8 0AimGAVWfv/S+LsZs7pViDJrF0xQMBH5dWD16ExmIStKdg1N3fE/ZyWDGjCU6DtHBi0m jsZA== X-Gm-Message-State: ALoCoQm/HwBBeuwxq5Sa8TaupkMzJmjVY5aY3nqLTZ14uXo82UfadSem/X/MxbRqLPeKGgfRfnu9 MIME-Version: 1.0 X-Received: by 10.107.170.36 with SMTP id t36mr1096999ioe.107.1439414096435; Wed, 12 Aug 2015 14:14:56 -0700 (PDT) Date: Wed, 12 Aug 2015 16:14:56 -0500 Message-ID: Subject: [PATCH] Fix two uses of __BEGIN_DECLS From: Stan Shebs To: "libc-alpha@sourceware.org" We ran across a couple cases of problems in headers when they were included in C++ sources, the positioning of extern "C" wrappers came out wrong. (Is there a test for this kind of thing? I didn't see anything relevant.) Stan 2015-08-12 Stan Shebs * elf/link.h: Move __BEGIN_DECLS up. * socket/sys/un.h: Include string.h before __BEGIN_DECLS. diff --git a/elf/link.h b/elf/link.h index eaca802..6ec9b55 100644 --- a/elf/link.h +++ b/elf/link.h @@ -34,6 +34,8 @@ #include /* Defines __ELF_NATIVE_CLASS. */ #include +__BEGIN_DECLS + /* Rendezvous structure used by the run-time dynamic linker to communicate details of shared object loading to the debugger. If the executable's dynamic section has a DT_DEBUG element, the run-time linker sets that @@ -162,8 +164,6 @@ struct dl_phdr_info void *dlpi_tls_data; }; -__BEGIN_DECLS - extern int dl_iterate_phdr (int (*__callback) (struct dl_phdr_info *, size_t, void *), void *__data); diff --git a/socket/sys/un.h b/socket/sys/un.h index 0059570..2fbf1fe 100644 --- a/socket/sys/un.h +++ b/socket/sys/un.h @@ -23,6 +23,10 @@ /* Get the definition of the macro to define the common sockaddr members. */ #include +#ifdef __USE_MISC +# include /* For prototype of `strlen'. */ +#endif + __BEGIN_DECLS /* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */ @@ -34,7 +38,6 @@ struct sockaddr_un #ifdef __USE_MISC -# include /* For prototype of `strlen'. */ /* Evaluate to actual length of the `sockaddr_un' structure. */ # define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \