Ticket #113: probe-MS-header-sal.patch

File probe-MS-header-sal.patch, 3.3 KB (added by fperrad, 13 years ago)
  • config/auto/headers.pm

     
    104104    if ( $conf->data->get_p5('OSNAME') eq "msys" ) { 
    105105        push @extra_headers, qw(sysmman.h netdb.h); 
    106106    } 
     107 
     108    if ( $conf->data->get_p5('OSNAME') eq "MSWin32" ) { 
     109        # Microsoft provides two annotations mechanisms.  __declspec, which has been 
     110        # around for a while, and Microsoft's standard source code annotation 
     111        # language (SAL), introduced with Visual C++ 8.0. 
     112        # See <http://msdn2.microsoft.com/en-us/library/ms235402(VS.80).aspx>, 
     113        # <http://msdn2.microsoft.com/en-us/library/dabb5z75(VS.80).aspx>. 
     114        push @extra_headers, qw(sal.h); 
     115    } 
     116 
    107117    return @extra_headers; 
    108118} 
    109119 
  • config/auto/msvc.pm

     
    9090        # To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help 
    9191        # for details. 
    9292        $conf->data->add( " ", "ccflags", "-D_CRT_SECURE_NO_DEPRECATE" ); 
    93  
    94         # Microsoft provides two annotations mechanisms.  __declspec, which has been 
    95         # around for a while, and Microsoft's standard source code annotation 
    96         # language (SAL), introduced with Visual C++ 8.0. 
    97         # See <http://msdn2.microsoft.com/en-us/library/ms235402(VS.80).aspx>, 
    98         # <http://msdn2.microsoft.com/en-us/library/dabb5z75(VS.80).aspx>. 
    99         $conf->data->set( HAS_MSVC_SAL => 1 ); 
    10093    } 
    10194    return 1; 
    10295} 
  • include/parrot/compiler.h

     
    9999 */ 
    100100#define UNUSED(a) /*@-noeffect*/if (0) (void)(a)/*@=noeffect*/; 
    101101 
    102 /* 64-bit CL has some problems, so this section here is going to try to fix them */ 
    103 #ifdef PARROT_HAS_MSVC_SAL 
    104 #  ifdef _WIN64 
    105     /* CL64 can't seem to find sal.h, so take that out of the equation */ 
    106 #    undef PARROT_HAS_MSVC_SAL 
    107     /* CL64 complains about not finding _iob, so this might fix it */ 
    108  
    109  
    110 #  endif 
    111 #endif 
    112  
    113 #ifdef PARROT_HAS_MSVC_SAL 
     102#ifdef PARROT_HAS_HEADER_SAL 
     103/* 
     104 * Microsoft provides two annotations mechanisms.  __declspec, which has been 
     105 * around for a while, and Microsoft's standard source code annotation 
     106 * language (SAL), introduced with Visual C++ 8.0. 
     107 * See <http://msdn2.microsoft.com/en-us/library/ms235402(VS.80).aspx>, 
     108 * <http://msdn2.microsoft.com/en-us/library/dabb5z75(VS.80).aspx>. 
     109 */ 
    114110#  include <sal.h> 
    115111#  define PARROT_CAN_RETURN_NULL      /*@null@*/ __maybenull 
    116112#  define PARROT_CANNOT_RETURN_NULL   /*@notnull@*/ __notnull 
    117113#else 
    118114#  define PARROT_CAN_RETURN_NULL      /*@null@*/ 
    119115#  define PARROT_CANNOT_RETURN_NULL   /*@notnull@*/ 
    120 #endif 
     116#endif /* PARROT_HAS_HEADER_SAL */ 
    121117 
    122118#define PARROT_DEPRECATED           __attribute__deprecated__ 
    123119 
     
    142138/* Function argument instrumentation */ 
    143139/* For explanations of the annotations, see http://www.splint.org/manual/manual.html */ 
    144140 
    145 #ifdef PARROT_HAS_MSVC_SAL 
     141#ifdef PARROT_HAS_HEADER_SAL 
    146142#  define NOTNULL(x)                  /*@notnull@*/ __notnull x 
    147143    /* The pointer passed may not be NULL */ 
    148144