Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14266 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16008 invoked by uid 1010); 3 Jan 2005 20:35:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 15989 invoked from network); 3 Jan 2005 20:35:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2005 20:35:19 -0000 X-Host-Fingerprint: 64.186.239.125 c-064-186-239-125.oc1.redwire.net Linux 2.4/2.6 Received: from ([64.186.239.125:2531] helo=mail.kromann.info) by pb1.pair.com (ecelerity HEAD (r3992M)) with SMTP id 15/A9-27561-68CA9D14 for ; Mon, 03 Jan 2005 15:35:19 -0500 Received: from warp (unknown [64.186.239.115]) by mail.kromann.info (Postfix) with SMTP id CA2512AE61; Mon, 3 Jan 2005 12:35:13 -0800 (PST) To: Wez Furlong Cc: , David Strauss X-Mailer: Swwwing 2000 Message-ID: <11047847408800000@9866357972520000.9866341568840000> MIME-Version: 1.0 Reply-To: "Frank M. Kromann" Date: Mon, 03 Jan 2005 12:39:00 -0800 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Critical typedef redefinitions From: frank@kromann.info ("Frank M. Kromann") Hi, Adding these two lines to main/win95nt.h kills these warnings with vs 6 typedef int socklen_t; #define HAVE_SOCKLEN_T 1 - Frank > We only support the MSVC compiler and libc under windows (there are > plenty of quirks and assumptions made about it for the win32 build). > > Changing that typedef is slightly tricky; I left it as it was because > there were compilation problems using older versons of MSVC and the > platform SDK, and this redefinition is benign. > > If you can test you proposed change with MSVC 6, VS.Net and your > VectorC compiler and make sure that it all still works, then we can > commit it. > > --Wez. > > On Sun, 02 Jan 2005 11:41:32 +0100, David Strauss wrote: > > Hi! > > > > There is a small problem in cgi_main.c preventing it to be compiled > > properly > > with some compilers. > > > > WS2tcpip.h will get included into cgi_main.c by following inclusion chain: > > cgi_main.c <- php_standard.h <- fsock.h <- php_network.h <- WS2tcpip.h > > > > Since php.h is included several lines before, socklen_t is already defined > > as: > > php.h (151): typedef unsigned int socklen_t; > > > > Now WS2tcpip.h gets included and tries to redefine socklen_t as: > > WS2tcpip.h (593): typedef int socklen_t; > > > > I successfully tested it with the VectorC compiler, where this lead to a > > terminal error. > > > > - David > > > > Addendum: > > If you take a look into the CVS snapshot build log, you'll probably see > > this > > warning quite a lot of times (58x according to my editor): > > C:\\Program Files\\Microsoft SDK\\Include\\.\ws2tcpip.h(593) : warning > > C4142: benign redefinition of type > > > > Since this occurs throughout the whole build, the easiest solution is > > proabably > > to just change the lines 150-152 in php.h to something like this: > > > > #ifndef HAVE_SOCKLEN_T > > # ifdef PHP_WIN32 > > typedef int socklen_t; > > # else > > typedef unsigned int socklen_t; > > # endif > > #endif > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >