CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #2
    Join Date
    Mar 2001
    Posts
    2,529

    Re: cross platform sockets

    I actually suggest using the pre-processor for this.

    You can :
    Code:
    #define MSWINDOWS 1
    and later:

    #ifdef MSWINDOWS
    //winsock only needed for windows, not free BSD or LINUX
    #pragma comment (lib, "ws2_32.lib")
    #endif
    using different #defines for different builds. In other words you can use seperate verbose for each OS yet in the same file with partially the same code. Just use #ifdefs where the syntax differrs.

    This way you can maintain one codebase for your cross platform application.

    HTH,

    ahoodin

    PS Don't forget to rate.
    Last edited by ahoodin; March 18th, 2005 at 09:24 AM. Reason: added in last comment

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured