Article View: borland.public.cppbuilder.nativeapi
Article #16101Re: BCB6 and winsock2.h
From: Simon Elliott
Date: Fri, 30 May 2003 10:05
Date: Fri, 30 May 2003 10:05
36 lines
2033 bytes
2033 bytes
Simon Elliott <simon@nospam.demon.co.uk> writes >Was winsock2.h automatically included in BCB3 if windows.h was included, >and has this situation changed for BCB6? To answer my own question, windows.h does seem to have changed significantly. === BCB3 === #if(_WIN32_WINNT >= 0x0400) #include <winsock2.h> #include <mswsock.h> #else #include <winsock.h> #endif /* _WIN32_WINNT >= 0x0400 */ === BCB6 === #include <winsock.h> This is a pain in the backside as it looks as if quite a bit of my BCB3 code will be broken by upgrading to BCB6. Much of this code needs to be compiled by both BCB3 and BCB6. Short of some kludgy conditionals, is there any way of accomplishing this? (I can't use the fact that #including winsock2.h pulls in windows.h automatically, as other 3rd party headers #include windows.h.) This works in BCB6 but alas doesn't work in BCB3: #include <winsock2.h> #define _WINSOCK2API_ #define _WINSOCKAPI_ -- Simon Elliott http://www.ctsn.co.uk/
Technical Details
Message-ID:
<wW2ZQDA1zy1+Iw25@courtlands.demon.co.uk>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!courtlands.demon.co.uk!simonReferences:
<yFSpUCAkxx1+IwGN@courtlands.demon.co.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,3fc5d067239e5bbf X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-30 03:26:01 PST Message-ID: <wW2ZQDA1zy1+Iw25@courtlands.demon.co.uk> Date: Fri, 30 May 2003 11:05:41 +0100 From: Simon Elliott <simon@nospam.demon.co.uk> Reply-To: Simon Elliott <news@courtlands.demon.co.uk> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: BCB6 and winsock2.h References: <yFSpUCAkxx1+IwGN@courtlands.demon.co.uk> Lines: 42 Organization: Courtlands Technical Services MIME-Version: 1.0 X-Newsreader: Turnpike Integrated Version 4.02 U <aLIvuQCpEWZ0Tu7eytpxRhrSSE> NNTP-Posting-Host: 158.152.154.121 X-Trace: newsgroups.borland.com 1054289156 158.152.154.121 (30 May 2003 03:05:56 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!courtlands.demon.co.uk!simon