]> git.openstreetmap.org Git - rails.git/blobdiff - db/functions/maptile.c
Initial version of contributor terms changes.
[rails.git] / db / functions / maptile.c
index c2baac5d467c109c2d392b18313b048a4319d7b4..ed83bcce29f1f88605c59163d2b470f42ccc4ad3 100644 (file)
@@ -55,12 +55,16 @@ long long maptile_for_point(UDF_INIT *initid, UDF_ARGS *args, char *is_null, cha
    double       lat = *(long long *)args->args[0] / 10000000.0;
    double       lon = *(long long *)args->args[1] / 10000000.0;
    long long    zoom = *(long long *)args->args[2];
-   
+
    return internal_maptile_for_point(lat, lon, zoom);
 }
 #endif
 
 #ifdef USE_PGSQL
+#ifdef USE_MYSQL
+#error ONLY one of USE_MYSQL and USE_PGSQL should be defined
+#endif
+
 #include <postgres.h>
 #include <fmgr.h>
 
@@ -70,7 +74,7 @@ maptile_for_point(PG_FUNCTION_ARGS)
   double lat = PG_GETARG_INT64(0) / 10000000.0;
   double lon = PG_GETARG_INT64(1) / 10000000.0;
   int zoom = PG_GETARG_INT32(2);
-  
+
   PG_RETURN_INT32(internal_maptile_for_point(lat, lon, zoom));
 }
 
@@ -79,7 +83,7 @@ PG_FUNCTION_INFO_V1(maptile_for_point);
 /*
  * To bind this into PGSQL, try something like:
  *
- * CREATE FUNCTION maptile_for_point(int8, int8, int4) RETURNS int4 
+ * CREATE FUNCTION maptile_for_point(int8, int8, int4) RETURNS int4
  *  AS '/path/to/rails-port/db/functions/libpgosm', 'maptile_for_point'
  *  LANGUAGE C STRICT;
  *