@matheusbsbs / matheus-bagliano / commits / fd94836923
Fork 0

fix portability problem with IS_RUN_COMMAND_ERR

Some old versions of gcc don't seem to like us negating an enum constant. Let's work around it by negating the other half of the comparison instead. Reported by Pierre Poissinger on gcc 2.9. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Mar 31, 2009 at 08:29 UTC fd94836923708581ca3f9b5c42a6d600c2f631dc
1 file changed +1 -1
run-command.h
+1 -1
@@ -10,7 +10,7 @@ enum {
10 ERR_RUN_COMMAND_WAITPID_SIGNAL,
11 ERR_RUN_COMMAND_WAITPID_NOEXIT,
12 };
13 -#define IS_RUN_COMMAND_ERR(x) ((x) <= -ERR_RUN_COMMAND_FORK)
13 +#define IS_RUN_COMMAND_ERR(x) (-(x) >= ERR_RUN_COMMAND_FORK)
14
15 struct child_process {
16 const char **argv;