Bläddra i källkod

Added missing source file. Fixes #33.

woollybah 6 år sedan
förälder
incheckning
e81a999e17
1 ändrade filer med 32 tillägg och 0 borttagningar
  1. 32 0
      jansson.mod/jansson/src/version.c

+ 32 - 0
jansson.mod/jansson/src/version.c

@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2019 Sean Bright <[email protected]>
+ *
+ * Jansson is free software; you can redistribute it and/or modify
+ * it under the terms of the MIT license. See LICENSE for details.
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include "jansson.h"
+
+const char *jansson_version_str(void)
+{
+    return JANSSON_VERSION;
+}
+
+int jansson_version_cmp(int major, int minor, int micro)
+{
+    int diff;
+
+    if ((diff = JANSSON_MAJOR_VERSION - major)) {
+        return diff;
+    }
+
+    if ((diff = JANSSON_MINOR_VERSION - minor)) {
+        return diff;
+    }
+
+    return JANSSON_MICRO_VERSION - micro;
+}