Ticket #824: config-msvc-sal.patch

File config-msvc-sal.patch, 2.0 KB (added by fperrad, 5 years ago)
  • 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 ); 
    93100    } 
    94101    return 1; 
    95102} 
  • include/parrot/compiler.h

     
    1414 * for a given compiler.  They are based on GCC's __attribute__ functionality. 
    1515 */ 
    1616 
    17 /* 
    18  * Microsoft provides two annotations mechanisms.  __declspec, which has been 
    19  * around for a while, and Microsoft's standard source code annotation 
    20  * language (SAL), introduced with Visual C++ 8.0. 
    21  * See <http://msdn2.microsoft.com/en-us/library/ms235402(VS.80).aspx>, 
    22  * <http://msdn2.microsoft.com/en-us/library/dabb5z75(VS.80).aspx>. 
    23  */ 
    24 #if defined(_MSC_VER) && (_MSC_VER >= 1400) 
    25 #  define PARROT_HAS_SAL 1 
    26 #  include <sal.h> 
    27 #else 
    28 #  define PARROT_HAS_SAL 0 
    29 #endif 
    30  
    3117#ifdef HASATTRIBUTE_NEVER_WORKS 
    3218 #  error This attribute can never succeed.  Something has mis-sniffed your configuration. 
    3319#endif 
     
    11399 */ 
    114100#define UNUSED(a) /*@-noeffect*/if (0) (void)(a)/*@=noeffect*/; 
    115101 
    116 #if PARROT_HAS_SAL 
     102#ifdef PARROT_HAS_MSVC_SAL 
     103#  include <sal.h> 
    117104#  define PARROT_CAN_RETURN_NULL      /*@null@*/ __maybenull 
    118105#  define PARROT_CANNOT_RETURN_NULL   /*@notnull@*/ __notnull 
    119106#else