CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    41

    if !defined( _WIN32 )

    i have a problem:
    my code was mostly compiled on unix machines.
    now we want to compile it on windows machines.
    However, we have a first problem: unistd.h seems not to be available via visual studio/windows.

    So I put that include-statement within the following #if-block:

    #if !defined( _WIN32 )
    #include <unistd.h>
    #endif

    Is this the best i could have done in this case?

    thank you

  2. #2
    Join Date
    Apr 2007
    Location
    Ireland
    Posts
    81

    Re: if !defined( _WIN32 )

    Yes, the standard approach is to wrap platform specific includes in Preprocessor #if / #else blocks.

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