]> git.draconx.ca Git - upkg.git/commitdiff
Work around missing SIZE_MAX.
authorNick Bowler <nbowler@draconx.ca>
Sun, 27 Feb 2022 19:44:11 +0000 (14:44 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sun, 27 Feb 2022 20:17:42 +0000 (15:17 -0500)
Older library implementations lack this macro.  Outside of an #if
directive the expression (size_t)-1 is equivalent so we can define
a fallback easily enough.

src/engine/mesh.gob
src/uobject/uobject.c

index 74b5b68b6d7c38fd764737a94d5ce3e5482ef003..8e60828ab0870c149e7b2ff4c9c1153a119acb6a 100644 (file)
 %}
 
 %{
-#include <stdint.h>
+#include <inttypes.h>
 #include <uobject/loadable.h>
 #include <uobject/exportable.h>
 #include "pack.h"
+
+#ifndef SIZE_MAX
+#  define SIZE_MAX ((size_t)-1)
+#endif
 %}
 
 %h{
index 3bada241cf9e7ed06a4c71c76dff59685fc7a275..0fbcd8dab2cd47b00a1ccd6374820bfa9e3704f7 100644 (file)
@@ -1,19 +1,19 @@
 /*
- *  upkg: tool for manipulating Unreal Tournament packages.
- *  Copyright © 2009-2012, 2015, 2020 Nick Bowler
+ * upkg: tool for manipulating Unreal Tournament packages.
+ * Copyright © 2009-2012, 2015, 2020, 2022 Nick Bowler
  *
- *  This program is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <config.h>
@@ -36,6 +36,9 @@
 #define U_OBJECT_GET_PRIV(o) \
        G_TYPE_INSTANCE_GET_PRIVATE(o, U_TYPE_OBJECT, struct u_object_priv)
 
+#ifndef SIZE_MAX
+#  define SIZE_MAX ((size_t)-1)
+#endif
 
 struct prop_head {
        const char *prop_name, *struct_name;