From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27093 invoked by alias); 12 Jul 2014 17:54:06 -0000 Mailing-List: contact cygwin-developers-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com Received: (qmail 27069 invoked by uid 89); 12 Jul 2014 17:54:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_NEUTRAL autolearn=ham version=3.3.2 X-HELO: bureau92.ns.utoronto.ca Received: from bureau92.ns.utoronto.ca (HELO bureau92.ns.utoronto.ca) (128.100.132.250) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sat, 12 Jul 2014 17:54:03 +0000 Received: from [192.168.1.112] (108-161-125-112.dsl.teksavvy.com [108.161.125.112] (may be forged)) (authenticated bits=0) by bureau92.ns.utoronto.ca (8.13.8/8.13.8) with ESMTP id s6CHrxWO005140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 12 Jul 2014 13:54:00 -0400 Message-ID: <53C17623.60807@cs.utoronto.ca> Date: Sat, 12 Jul 2014 17:54:00 -0000 From: Ryan Johnson User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: cygwin-developers@cygwin.com Subject: Broken header dirent.h Content-Type: multipart/mixed; boundary="------------040408090008020108010604" X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00000.txt.bz2 This is a multi-part message in MIME format. --------------040408090008020108010604 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 289 Hi all, Please CC me in replies, I'm no longer a list member. I recently tried to use in a C++ program and got linker errors. Turns out the header is neither C++-aware (extern "C") nor cygwin-aware (_EXFUN). The attached patch fixes the problem for me. Regards, Ryan --------------040408090008020108010604 Content-Type: text/plain; charset=windows-1252; name="dirent.h.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dirent.h.patch" Content-length: 2154 --- dirent.h.orig 2014-05-23 04:36:40.000000000 -0400 +++ dirent.h 2014-07-12 12:31:44.904628400 -0400 @@ -15,6 +15,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define __DIRENT_VERSION 2 #ifndef __x86_64__ @@ -62,32 +66,32 @@ #pragma pack(pop) #endif -DIR *opendir (const char *); -DIR *fdopendir (int); -struct dirent *readdir (DIR *); -int readdir_r (DIR * __restrict, struct dirent * __restrict, - struct dirent ** __restrict); -void rewinddir (DIR *); -int closedir (DIR *); +DIR *_EXFUN(opendir, (const char *)); +DIR *_EXFUN(fdopendir, (int)); +struct dirent *_EXFUN(readdir, (DIR *)); +int _EXFUN(readdir_r, (DIR * __restrict, struct dirent * __restrict, + struct dirent ** __restrict)); +void _EXFUN(rewinddir, (DIR *)); +int _EXFUN(closedir, (DIR *)); -int dirfd (DIR *); +int _EXFUN(dirfd, (DIR *)); #ifndef _POSIX_SOURCE #ifndef __INSIDE_CYGWIN__ -long telldir (DIR *); -void seekdir (DIR *, long loc); +long _EXFUN(telldir, (DIR *)); +void _EXFUN(seekdir, (DIR *, long loc)); #endif -int scandir (const char *__dir, +int _EXFUN(scandir, (const char *__dir, struct dirent ***__namelist, int (*select) (const struct dirent *), - int (*compar) (const struct dirent **, const struct dirent **)); + int (*compar) (const struct dirent **, const struct dirent **))); -int scandirat (int __dirfd, const char *__dir, struct dirent ***__namelist, +int _EXFUN(scandirat, (int __dirfd, const char *__dir, struct dirent ***__namelist, int (*select) (const struct dirent *), - int (*compar) (const struct dirent **, const struct dirent **)); + int (*compar) (const struct dirent **, const struct dirent **))); -int alphasort (const struct dirent **__a, const struct dirent **__b); +int _EXFUN(alphasort, (const struct dirent **__a, const struct dirent **__b)); #ifdef _DIRENT_HAVE_D_TYPE /* File types for `d_type'. */ enum @@ -117,4 +121,8 @@ # define DTTOIF(dirtype) ((dirtype) << 12) #endif /* _DIRENT_HAVE_D_TYPE */ #endif /* _POSIX_SOURCE */ + +#ifdef __cplusplus +} +#endif #endif /*_SYS_DIRENT_H*/ --------------040408090008020108010604--