round() is not portable. Use rint().
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 8 Sep 2011 20:37:40 +0000 (16:37 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 8 Sep 2011 20:38:24 +0000 (16:38 -0400)
src/backend/access/gist/gistbuild.c

index 831923851060089972efe75ae02d280e1d23297c..58f1ef221e12196dc735a0aeece0036aaff0669a 100644 (file)
@@ -14,6 +14,8 @@
  */
 #include "postgres.h"
 
+#include <math.h>
+
 #include "access/genam.h"
 #include "access/gist_private.h"
 #include "catalog/index.h"
@@ -420,7 +422,7 @@ calculatePagesPerBuffer(GISTBuildState *buildstate, int levelStep)
     */
    pagesPerBuffer = 2 * pow(avgIndexTuplesPerPage, levelStep);
 
-   return round(pagesPerBuffer);
+   return (int) rint(pagesPerBuffer);
 }
 
 /*