commit 394ece97028f554022014ad299c32eddc82d36f8
parent 425dbb6554835694af498b06491634c96b73f3ab
Author: Oliver Lowe <o@olowe.co>
Date: Mon, 1 Sep 2025 17:20:42 +1000
Drop support for y2038 unfixed systems
musl libc converted to 64-bit time_t on 32-bit systems already
Diffstat:
4 files changed, 14 insertions(+), 40 deletions(-)
diff --git a/configure.ac b/configure.ac
@@ -107,27 +107,6 @@ AC_SYS_LARGEFILE
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
-AC_MSG_CHECKING([for time_t format specifier])
-_gcc_cflags_save=$CFLAGS
-CFLAGS="-Wformat -Werror"
-AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
- #include <stdio.h>
- #include <time.h>
- ]],[[printf("%lld", time(NULL));]])],
- [time_t_long_long=yes],
- [time_t_long_long=no])
-CFLAGS=$_gcc_cflags_save
-
-if test x"$time_t_long_long" = xyes; then
- time_t_fmt=lld
-else
- time_t_fmt=ld
-fi
-AC_MSG_RESULT([$time_t_fmt])
-AC_DEFINE_UNQUOTED([CM_TIME_FORMAT], ["$time_t_fmt"],
- [Define printf format specifier for time_t])
-
AM_CFLAGS="-Wall"
if test $USE_MAINTAINER_MODE = yes; then
AM_CFLAGS="$AM_CFLAGS -g"
@@ -141,7 +120,6 @@ AM_ICONV
dnl floor and ceil are in -lm
LIBS="$LIBS -lm"
-dnl for gettext
GETTEXT_PACKAGE=claws-mail
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
@@ -214,10 +192,6 @@ dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(strcasestr)
-dnl *****************
-dnl ** common code **
-dnl *****************
-
dnl check for glib
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.50 gmodule-2.0 >= 2.50 gobject-2.0 >= 2.50 gthread-2.0 >= 2.50])
diff --git a/src/common/utils.c b/src/common/utils.c
@@ -3863,7 +3863,7 @@ size_t fast_strftime(gchar *buf, gint buflen, const gchar *format, struct tm *lt
*curpos++ = '0'+(lt->tm_min % 10);
break;
case 's':
- snprintf(subbuf, 64, "%" CM_TIME_FORMAT, mktime(lt));
+ snprintf(subbuf, 64, "%lld", mktime(lt));
len = strlen(subbuf); CHECK_SIZE();
strncpy2(curpos, subbuf, buflen - total_done);
break;
diff --git a/src/common/xml.c b/src/common/xml.c
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ *
*/
#ifdef HAVE_CONFIG_H
@@ -36,7 +36,7 @@
/* if this is defined all attr.names and tag.names are stored
* in a hash table */
#if defined(SPARSE_MEMORY)
-#include "stringtable.h"
+#include "stringtable.h"
static StringTable *xml_string_table;
static XMLTag *xml_copy_tag (XMLTag *tag);
@@ -254,7 +254,7 @@ next:
buf[len - 1] = '\0';
g_strchomp(buf);
}
-
+
if (strlen(buf) == 0) {
g_warning("xml_parse_next_tag(): tag name is empty in %s", file->path);
return -1;
@@ -474,25 +474,25 @@ XMLNode *xml_node_new(XMLTag *tag, const gchar *text)
XMLTag *xml_tag_new(const gchar *tag)
{
XMLTag *new_tag;
-
+
new_tag = g_new(XMLTag, 1);
if (tag)
new_tag->tag = XML_STRING_ADD(tag);
else
new_tag->tag = NULL;
new_tag->attr = NULL;
-
+
return new_tag;
}
XMLAttr *xml_attr_new(const gchar *name, const gchar *value)
{
XMLAttr *new_attr;
-
+
new_attr = g_new(XMLAttr, 1);
new_attr->name = XML_STRING_ADD(name);
new_attr->value = g_strdup(value);
-
+
return new_attr;
}
@@ -506,7 +506,7 @@ XMLAttr *xml_attr_new_int(const gchar *name, const gint value)
new_attr = g_new(XMLAttr, 1);
new_attr->name = XML_STRING_ADD(name);
new_attr->value = valuestr;
-
+
return new_attr;
}
@@ -515,7 +515,7 @@ XMLAttr *xml_attr_new_time_t(const gchar *name, const time_t value)
XMLAttr *new_attr;
gchar *valuestr;
- valuestr = g_strdup_printf("%"CM_TIME_FORMAT, value);
+ valuestr = g_strdup_printf("%lld", value);
new_attr = g_new(XMLAttr, 1);
new_attr->name = XML_STRING_ADD(name);
@@ -732,7 +732,7 @@ static int xml_write_tree_recursive(GNode *node, FILE *fp)
TRY(fprintf(fp, " %s=\"", attr->name) > 0);
TRY(xml_file_put_escape_str(fp, attr->value) == 0);
TRY(fputs("\"", fp) != EOF);
-
+
}
if (node->children) {
@@ -753,7 +753,7 @@ static int xml_write_tree_recursive(GNode *node, FILE *fp)
TRY(fprintf(fp, "</%s>\n", tag->tag) > 0);
} else
TRY(fputs(" />\n", fp) != EOF);
-
+
return 0;
}
@@ -768,7 +768,7 @@ static gpointer copy_node_func(gpointer nodedata, gpointer data)
{
XMLNode *xmlnode = (XMLNode *) nodedata;
XMLNode *newxmlnode;
-
+
newxmlnode = g_new0(XMLNode, 1);
newxmlnode->tag = xml_copy_tag(xmlnode->tag);
newxmlnode->element = g_strdup(xmlnode->element);
diff --git a/src/mh.c b/src/mh.c
@@ -1281,6 +1281,6 @@ static void mh_set_mtime(Folder *folder, FolderItem *item)
}
item->mtime = s.st_mtime;
- debug_print("MH: forced mtime of %s to %"CM_TIME_FORMAT"\n", item->name?item->name:"(null)", item->mtime);
+ debug_print("MH: forced mtime of %s to %lld\n", item->name?item->name:"(null)", item->mtime);
g_free(path);
}