[svn:parrot] r41298 - in trunk: config/auto include/parrot

fperrad at svn.parrot.org fperrad at svn.parrot.org
Wed Sep 16 16:59:34 UTC 2009


Author: fperrad
Date: Wed Sep 16 16:59:31 2009
New Revision: 41298
URL: https://trac.parrot.org/parrot/changeset/41298

Log:
[msvc] probe sal.h
see TT #113

Modified:
   trunk/config/auto/headers.pm
   trunk/config/auto/msvc.pm
   trunk/include/parrot/compiler.h

Modified: trunk/config/auto/headers.pm
==============================================================================
--- trunk/config/auto/headers.pm	Wed Sep 16 16:37:20 2009	(r41297)
+++ trunk/config/auto/headers.pm	Wed Sep 16 16:59:31 2009	(r41298)
@@ -104,6 +104,16 @@
     if ( $conf->data->get_p5('OSNAME') eq "msys" ) {
         push @extra_headers, qw(sysmman.h netdb.h);
     }
+
+    if ( $conf->data->get_p5('OSNAME') eq "MSWin32" ) {
+        # Microsoft provides two annotations mechanisms.  __declspec, which has been
+        # around for a while, and Microsoft's standard source code annotation
+        # language (SAL), introduced with Visual C++ 8.0.
+        # See <http://msdn2.microsoft.com/en-us/library/ms235402(VS.80).aspx>,
+        # <http://msdn2.microsoft.com/en-us/library/dabb5z75(VS.80).aspx>.
+        push @extra_headers, qw(sal.h);
+    }
+
     return @extra_headers;
 }
 

Modified: trunk/config/auto/msvc.pm
==============================================================================
--- trunk/config/auto/msvc.pm	Wed Sep 16 16:37:20 2009	(r41297)
+++ trunk/config/auto/msvc.pm	Wed Sep 16 16:59:31 2009	(r41298)
@@ -90,13 +90,6 @@
         # To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help
         # for details.
         $conf->data->add( " ", "ccflags", "-D_CRT_SECURE_NO_DEPRECATE" );
-
-        # Microsoft provides two annotations mechanisms.  __declspec, which has been
-        # around for a while, and Microsoft's standard source code annotation
-        # language (SAL), introduced with Visual C++ 8.0.
-        # See <http://msdn2.microsoft.com/en-us/library/ms235402(VS.80).aspx>,
-        # <http://msdn2.microsoft.com/en-us/library/dabb5z75(VS.80).aspx>.
-        $conf->data->set( HAS_MSVC_SAL => 1 );
     }
     return 1;
 }

Modified: trunk/include/parrot/compiler.h
==============================================================================
--- trunk/include/parrot/compiler.h	Wed Sep 16 16:37:20 2009	(r41297)
+++ trunk/include/parrot/compiler.h	Wed Sep 16 16:59:31 2009	(r41298)
@@ -103,25 +103,21 @@
  */
 #define UNUSED(a) /*@-noeffect*/if (0) (void)(a)/*@=noeffect*/;
 
-/* 64-bit CL has some problems, so this section here is going to try to fix them */
-#ifdef PARROT_HAS_MSVC_SAL
-#  ifdef _WIN64
-    /* CL64 can't seem to find sal.h, so take that out of the equation */
-#    undef PARROT_HAS_MSVC_SAL
-    /* CL64 complains about not finding _iob, so this might fix it */
-
-
-#  endif
-#endif
-
-#ifdef PARROT_HAS_MSVC_SAL
+#ifdef PARROT_HAS_HEADER_SAL
+/*
+ * Microsoft provides two annotations mechanisms.  __declspec, which has been
+ * around for a while, and Microsoft's standard source code annotation
+ * language (SAL), introduced with Visual C++ 8.0.
+ * See <http://msdn2.microsoft.com/en-us/library/ms235402(VS.80).aspx>,
+ * <http://msdn2.microsoft.com/en-us/library/dabb5z75(VS.80).aspx>.
+ */
 #  include <sal.h>
 #  define PARROT_CAN_RETURN_NULL      /*@null@*/ __maybenull
 #  define PARROT_CANNOT_RETURN_NULL   /*@notnull@*/ __notnull
 #else
 #  define PARROT_CAN_RETURN_NULL      /*@null@*/
 #  define PARROT_CANNOT_RETURN_NULL   /*@notnull@*/
-#endif
+#endif /* PARROT_HAS_HEADER_SAL */
 
 #define PARROT_DEPRECATED           __attribute__deprecated__
 
@@ -146,7 +142,7 @@
 /* Function argument instrumentation */
 /* For explanations of the annotations, see http://www.splint.org/manual/manual.html */
 
-#ifdef PARROT_HAS_MSVC_SAL
+#ifdef PARROT_HAS_HEADER_SAL
 #  define NOTNULL(x)                  /*@notnull@*/ __notnull x
     /* The pointer passed may not be NULL */
 


More information about the parrot-commits mailing list