diff -ur /home/dan/src/M2/1.6/M2/BUILD/dan/builds.tmp/mingw.debug/libraries/gfan/tmp/gfan0.5/app_minkowski.cpp gfan0.5/app_minkowski.cpp
--- /home/dan/src/M2/1.6/M2/BUILD/dan/builds.tmp/mingw.debug/libraries/gfan/tmp/gfan0.5/app_minkowski.cpp	2011-01-25 09:33:15.000000000 -0600
+++ gfan0.5/app_minkowski.cpp	2013-05-11 00:11:37.016925200 -0500
@@ -160,7 +160,7 @@
 	    //log0 fprintf(Stderr,"4");
 	    f.insert(c);
 	    //log0 fprintf(Stderr,"5\n");
-	    static int i;
+	    //static int i;
 	    //log0 fprintf(Stderr,"inserted:%i\n",++i);
 	  }
 	log1 fprintf(Stderr,"Resolving symmetries.\n");
diff -ur /home/dan/src/M2/1.6/M2/BUILD/dan/builds.tmp/mingw.debug/libraries/gfan/tmp/gfan0.5/application.cpp gfan0.5/application.cpp
--- /home/dan/src/M2/1.6/M2/BUILD/dan/builds.tmp/mingw.debug/libraries/gfan/tmp/gfan0.5/application.cpp	2011-01-25 09:33:16.000000000 -0600
+++ gfan0.5/application.cpp	2013-05-11 00:32:32.435731000 -0500
@@ -20,14 +20,9 @@
 {
   // extracts filename from argv[0]
   int l=strlen(p);
-  assert(l>0);
-  do
-    {
-      l--;
-    }
-  while(p[l]!=0 && p[l]!='/');
-
-  return p+l+1;
+  if (l>4 && 0 == strcmp(p+l-4,".exe")) p[l-=4] = 0; // chop off any trailing ".exe", present under mingw64
+  while (l>0 && p[l-1]!='/' && p[l-1]!='\\') l--;
+  return p+l;
 }
 
 static char* tail(char *p)
diff -ur /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/app_fiberpolytope.cpp gfan0.5/app_fiberpolytope.cpp
--- /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/app_fiberpolytope.cpp	2011-01-25 10:33:15.000000000 -0500
+++ gfan0.5/app_fiberpolytope.cpp	2015-06-02 22:30:52.000000000 -0400
@@ -63,7 +63,7 @@
 
 	    /* If the vector configuration B does not have full rank then
 	       change coordinates. */
-	    if(rank(B)!=B.getHeight())
+	    if(rankOfIntegerMatrix(B)!=B.getHeight())
 	      {
 	        FieldMatrix M=integerMatrixToFieldMatrix(B,Q);
 	        M.reduce(false,true);//force integer operations - preserving volume
@@ -83,7 +83,7 @@
 	    log1 debug<<"Done computing restricting cone\n";
 
 	    debug<<B.getRows();
-	    debug<<int(rank(B));
+	    debug<<int(rankOfIntegerMatrix(B));
 
 	    Triangulation2 t(B);
 log1 debug<<"Computing initial triangulation\n";
diff -ur /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/app_secondaryfan.cpp gfan0.5/app_secondaryfan.cpp
--- /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/app_secondaryfan.cpp	2011-01-25 10:33:15.000000000 -0500
+++ gfan0.5/app_secondaryfan.cpp	2015-06-02 22:31:54.000000000 -0400
@@ -307,7 +307,7 @@
 
     if(scaleOption.getValue())
       {
-	if(rank(A)!=A.getHeight())
+	if(rankOfIntegerMatrix(A)!=A.getHeight())
 	  {
 	    cerr << "The vector configuration must have full rank in order to use the scale option.\n";
 	    assert(0);
@@ -342,7 +342,7 @@
 
     /* If the vector configuration A does not have full rank then
        change coordinates. */
-    if(rank(A)!=A.getHeight())
+    if(rankOfIntegerMatrix(A)!=A.getHeight())
       {
 	FieldMatrix M=integerMatrixToFieldMatrix(A,Q);
 	M.reduce(false,true);//force integer operations - preserving volume
diff -ur /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/gfanlib_polyhedralfan.h gfan0.5/gfanlib_polyhedralfan.h
--- /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/gfanlib_polyhedralfan.h	2011-01-25 10:33:18.000000000 -0500
+++ gfan0.5/gfanlib_polyhedralfan.h	2015-06-02 22:17:05.000000000 -0400
@@ -52,7 +52,7 @@
   int getAmbientDimension()const;
   int getMaxDimension()const;
   int getMinDimension()const;
-  friend PolyhedralFan refinement(const PolyhedralFan &a, const PolyhedralFan &b, int cutOffDimension=-1, bool allowASingleConeOfCutOffDimension=false);
+  friend PolyhedralFan refinement(const PolyhedralFan &a, const PolyhedralFan &b, int cutOffDimension, bool allowASingleConeOfCutOffDimension);
   ZMatrix getRays(int dim=1);//This can be called for other dimensions than 1. The term "Rays" still makes sense modulo the common linearity space
   ZMatrix getRelativeInteriorPoints();
   void insert(ZCone const &c);
@@ -104,6 +104,7 @@
 //  static PolyhedralFan readFan(string const &filename, bool onlyMaximal=true, IntegerVector *w=0, set<int> const *conesIndice=0, SymmetryGroup const *sym=0, bool readCompressedIfNotSym=false);
 };
 
+PolyhedralFan refinement(const PolyhedralFan &a, const PolyhedralFan &b, int cutOffDimension=-1, bool allowASingleConeOfCutOffDimension=false);
 
 void addFacesToSymmetricComplex(SymmetricComplex &c, ZCone const &cone, ZMatrix const &facetCandidates, ZMatrix const &generatorsOfLinealitySpace);
 void addFacesToSymmetricComplex(SymmetricComplex &c, std::set<int> const &indices, ZMatrix const &facetCandidates, int dimension, Integer multiplicity);
diff -ur /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/gmpallocator.cpp gfan0.5/gmpallocator.cpp
--- /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/gmpallocator.cpp	2011-01-25 10:33:16.000000000 -0500
+++ gfan0.5/gmpallocator.cpp	2015-06-02 22:15:20.000000000 -0400
@@ -1,3 +1,4 @@
+#include <cstddef>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
diff -ur /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/halfopencone.h gfan0.5/halfopencone.h
--- /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/halfopencone.h	2011-01-25 10:33:18.000000000 -0500
+++ gfan0.5/halfopencone.h	2015-06-02 22:14:28.000000000 -0400
@@ -6,6 +6,8 @@
 
 #include "polyhedralfan.h"
 
+
+
 class HalfOpenCone{
   static void appendList(IntegerVectorList &to, IntegerVectorList const &from, int appendValue);
   int liftedDimension;//ambient
@@ -18,7 +20,7 @@
   HalfOpenCone(int dimension_, IntegerVectorList const &equations, IntegerVectorList const &nonstrict, IntegerVectorList const &strict, bool findFacets=false, bool canonicalize=false);
   HalfOpenCone(int ambientDimension);//full space
   bool isEmpty();
-  friend HalfOpenCone intersection(const HalfOpenCone &a, const HalfOpenCone &b, bool findFacets=false);
+  friend HalfOpenCone intersection(const HalfOpenCone &a, const HalfOpenCone &b, bool findFacets);
   friend bool haveEmptyIntersection(const HalfOpenCone &a, const HalfOpenCone &b);
   PolyhedralCone closure();
   void splitIntoRelativelyOpenCones(list<HalfOpenCone> &l);
@@ -35,6 +37,8 @@
   HalfOpenCone rewriteExpand(list<int> pivots, IntegerVectorList const &newEquations)const;
 };
 
+HalfOpenCone intersection(const HalfOpenCone &a, const HalfOpenCone &b, bool findFacets=false);
+
 typedef list<HalfOpenCone> HalfOpenConeList;
 
 HalfOpenConeList orientedBoundary(PolyhedralCone C, TermOrder const &t, HalfOpenCone *restrictingCone=0);
diff -ur /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/matrix.cpp gfan0.5/matrix.cpp
--- /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/matrix.cpp	2011-01-25 10:33:16.000000000 -0500
+++ gfan0.5/matrix.cpp	2015-06-02 22:29:56.000000000 -0400
@@ -61,7 +61,7 @@
 
 #include "linalg.h"
 
-int rank(IntegerMatrix const &m)
+int rankOfIntegerMatrix(IntegerMatrix const &m)
 {
   return integerMatrixToFieldMatrix(m,Q).rank();
 }
diff -ur /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/matrix.h gfan0.5/matrix.h
--- /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/matrix.h	2011-01-25 10:33:18.000000000 -0500
+++ gfan0.5/matrix.h	2015-06-02 22:30:24.000000000 -0400
@@ -147,6 +147,6 @@
 
 FloatMatrix integerToFloatMatrix(IntegerMatrix const &m);
 IntegerVector flattenMatrix(IntegerMatrix const &m);
-int rank(IntegerMatrix const &m);
+int rankOfIntegerMatrix(IntegerMatrix const &m);
 
 #endif
diff -ur /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/polyhedralfan.h gfan0.5/polyhedralfan.h
--- /Users/mike/src/M2/M2/BUILD/mike/builds.tmp/opt64-clang-full/libraries/gfan/tmp/gfan0.5/polyhedralfan.h	2011-01-25 10:33:18.000000000 -0500
+++ gfan0.5/polyhedralfan.h	2015-06-02 22:12:50.000000000 -0400
@@ -30,6 +30,7 @@
   FPF_default=2+4+8
 };
 
+PolyhedralFan refinement(const PolyhedralFan &a, const PolyhedralFan &b, int cutOffDimension=-1, bool allowASingleConeOfCutOffDimension=false);
 
 /** A PolyhedralFan is simply a collection of canonicalized PolyhedralCones.
  * It contains no combinatorial information in the sense of a polyhedral complex.
@@ -74,7 +75,7 @@
   int getAmbientDimension()const;
   int getMaxDimension()const;
   int getMinDimension()const;
-  friend PolyhedralFan refinement(const PolyhedralFan &a, const PolyhedralFan &b, int cutOffDimension=-1, bool allowASingleConeOfCutOffDimension=false);
+  friend PolyhedralFan refinement(const PolyhedralFan &a, const PolyhedralFan &b, int cutOffDimension, bool allowASingleConeOfCutOffDimension);
   friend PolyhedralFan product(const PolyhedralFan &a, const PolyhedralFan &b);
   IntegerVectorList getRays(int dim=1);//This can be called for other dimensions than 1. The term "Rays" still makes sense modulo the common linearity space
   IntegerVectorList getRelativeInteriorPoints();
