compat: remove gitmkdtemp()

gitmkdtemp() has become a trivial wrapper around git_mkdtemp(). Remove this now unnecessary layer of indirection. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Dec 6, 2025 at 14:35 UTC 10bba537c4c23e713af05be700748c6a3c25bf68
5 files changed +2 -14
Makefile
-1
@@ -1917,7 +1917,6 @@ ifdef NO_SETENV
1917 endif
1918 ifdef NO_MKDTEMP
1919 COMPAT_CFLAGS += -DNO_MKDTEMP
1920 - COMPAT_OBJS += compat/mkdtemp.o
1920 endif
1921 ifdef MKDIR_WO_TRAILING_SLASH
1922 COMPAT_CFLAGS += -DMKDIR_WO_TRAILING_SLASH
compat/mkdtemp.c deleted
-6
@@ -1,6 +0,0 @@
1 -#include "../git-compat-util.h"
2 -
3 -char *gitmkdtemp(char *template)
4 -{
5 - return git_mkdtemp(template);
6 -}
compat/posix.h
+1 -2
@@ -329,8 +329,7 @@ int gitsetenv(const char *, const char *, int);
329 #endif
330
331 #ifdef NO_MKDTEMP
332 -#define mkdtemp gitmkdtemp
333 -char *gitmkdtemp(char *);
332 +#define mkdtemp git_mkdtemp
333 #endif
334
335 #ifdef NO_UNSETENV
contrib/buildsystems/CMakeLists.txt
-4
@@ -411,10 +411,6 @@ if(NOT HAVE_SETENV)
411 list(APPEND compat_SOURCES compat/setenv.c)
412 endif()
413
414 -if(NOT HAVE_MKDTEMP)
415 - list(APPEND compat_SOURCES compat/mkdtemp.c)
416 -endif()
417 -
414 if(NOT HAVE_PREAD)
415 list(APPEND compat_SOURCES compat/pread.c)
416 endif()
meson.build
+1 -1
@@ -1401,7 +1401,7 @@ checkfuncs = {
1401 'strlcpy' : ['strlcpy.c'],
1402 'strtoull' : [],
1403 'setenv' : ['setenv.c'],
1404 - 'mkdtemp' : ['mkdtemp.c'],
1404 + 'mkdtemp' : [],
1405 'initgroups' : [],
1406 'strtoumax' : ['strtoumax.c', 'strtoimax.c'],
1407 'pread' : ['pread.c'],