Skip to content

Commit ebc3278

Browse files
harry-hovgitster
authored andcommitted
git-compat-util.h: drop the PRIuMAX and other fallback definitions
Git's code base already seems to be using `PRIdMAX` without any such fallback definition for quite a while (7545941 (json_writer: new routines to create JSON data, 2018-07-13), to be precise, and the first Git version to include that commit was v2.19.0). Having a fallback definition only for `PRIuMAX` is a bit inconsistent. We do sometimes get portability reports more than a year after the problem was introduced. This one should be fairly safe. PRIuMAX is in C99 (for that matter, SCNuMAX, PRIu32 and others also are), and we've been picking up other C99-isms without complaint. The PRIuMAX fallback definition was originally added in 3efb1f3 (Check for PRIuMAX rather than NO_C99_FORMAT in fast-import.c., 2007-02-20). But it was replacing a construct that was introduced in an even earlier commit, 579d1fb (Add NO_C99_FORMAT to support older compilers., 2006-07-30), which talks about gcc 2.95. That's pretty ancient at this point. Signed-off-by: Hariom Verma <[email protected]> Helped-by: Jeff King <[email protected]> [jc: tweaked both message and code, taking what peff wrote] Signed-off-by: Junio C Hamano <[email protected]>
1 parent d9f6f3b commit ebc3278

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

git-compat-util.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -320,26 +320,6 @@ char *gitdirname(char *);
320320
#define PATH_MAX 4096
321321
#endif
322322

323-
#ifndef PRIuMAX
324-
#define PRIuMAX "llu"
325-
#endif
326-
327-
#ifndef SCNuMAX
328-
#define SCNuMAX PRIuMAX
329-
#endif
330-
331-
#ifndef PRIu32
332-
#define PRIu32 "u"
333-
#endif
334-
335-
#ifndef PRIx32
336-
#define PRIx32 "x"
337-
#endif
338-
339-
#ifndef PRIo32
340-
#define PRIo32 "o"
341-
#endif
342-
343323
typedef uintmax_t timestamp_t;
344324
#define PRItime PRIuMAX
345325
#define parse_timestamp strtoumax

0 commit comments

Comments
 (0)