Fix compiler warnings
[smlar.git] / smlar.c
diff --git a/smlar.c b/smlar.c
index 13c8169..ca0651f 100644 (file)
--- a/smlar.c
+++ b/smlar.c
@@ -16,7 +16,9 @@
 #include "utils/fmgroids.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
+#if (PG_VERSION_NUM < 120000)
 #include "utils/tqual.h"
+#endif
 #include "utils/syscache.h"
 #include "utils/typcache.h"
 
@@ -28,6 +30,11 @@ PG_MODULE_MAGIC;
 #define SNAPSHOT SnapshotNow
 #endif
 
+#if PG_VERSION_NUM >= 130000
+#define heap_open(r, l)                        table_open((r), (l))
+#define heap_close(r, l)               table_close((r), (l))
+#endif
+
 static Oid
 getDefaultOpclass(Oid amoid, Oid typid)
 {
@@ -56,7 +63,11 @@ getDefaultOpclass(Oid amoid, Oid typid)
                {
                        if ( OidIsValid(opclassOid) )
                                elog(ERROR, "Ambiguous opclass for type %u (access method %u)", typid, amoid); 
+#if (PG_VERSION_NUM >= 120000)
+                       opclassOid = opclass->oid;
+#else
                        opclassOid = HeapTupleGetOid(tuple);
+#endif
                }
        }
 
@@ -515,6 +526,7 @@ Array2SimpleArrayU(ProcTypeInfo info, ArrayType *a, void *cache)
                                                {
                                                        case TF_LOG:
                                                                s->df[i] = (1.0 + log( s->df[i] ));
+                                                               /* FALLTHROUGH */
                                                        case TF_N:
                                                                s->df[i] *= stat->idf;
                                                                break;