[libmath-prime-util-perl] 05/13: Compile issues, especially MSC

Partha P. Mukherjee ppm-guest at moszumanska.debian.org
Thu May 21 18:45:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

ppm-guest pushed a commit to annotated tag v0.11
in repository libmath-prime-util-perl.

commit 22003b3313d5a1caf083cc42d70a5f9386b1c1c8
Author: Dana Jacobsen <dana at acm.org>
Date:   Thu Jul 19 09:58:16 2012 -0700

    Compile issues, especially MSC
---
 Changes  |  1 +
 XS.xs    |  2 +-
 ptypes.h | 12 ++++++++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/Changes b/Changes
index 6075455..f40dbf0 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,7 @@ Revision history for Perl extension Math::Prime::Util.
 0.11  19 July 2012
     - Turn of threading tests on Cygwin, as threads now gives random panics.
     - Use pow instead of exp2 -- some systems don't have exp2.
+    - Fix compile issues on MSC, thanks to Sisyphus.
 
 
 0.10  16 July 2012
diff --git a/XS.xs b/XS.xs
index 3927039..22292f8 100644
--- a/XS.xs
+++ b/XS.xs
@@ -273,10 +273,10 @@ _XS_factor(IN UV n)
             n = tofac_stack[ntofac];  /* Set n to the other one */
           } else {
             /* trial divisions */
-            if (verbose) printf("doing trial on %"UVuf"\n", n);
             UV f = tlim;
             UV m = tlim % 30;
             UV limit = (UV) (sqrt(n)+0.1);
+            if (verbose) printf("doing trial on %"UVuf"\n", n);
             while (f <= limit) {
               if ( (n%f) == 0 ) {
                 do {
diff --git a/ptypes.h b/ptypes.h
index e7f604a..9cbee9a 100644
--- a/ptypes.h
+++ b/ptypes.h
@@ -1,8 +1,20 @@
 #ifndef MPU_PTYPES_H
 #define MPU_PTYPES_H
 
+#ifndef _MSC_VER
 #define __STDC_LIMIT_MACROS
 #include <stdint.h>
+#else
+ /* No stdint.h for MS C, so we lose the chance to possibly optimize
+  * some operations on 64-bit machines running a 32-bit Perl.  It's probably
+  * a rare enough case that we don't need to be too concerned.  If we do want,
+  * see:  http://gauss.cs.ucsb.edu/~aydin/CombBLAS/html/stdint_8h_source.html
+  * for some ideas.
+  *
+  *  Thanks to Sisyphus for bringing the MSC issue to my attention (and even
+  *  submitting a working patch!).
+  */
+#endif
 
 #include "EXTERN.h"
 #include "perl.h"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git



More information about the Pkg-perl-cvs-commits mailing list