Skip to content

Commit fd94836

Browse files
peffgitster
authored andcommitted
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 <[email protected]>
1 parent bf63780 commit fd94836

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

run-command.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ enum {
1010
ERR_RUN_COMMAND_WAITPID_SIGNAL,
1111
ERR_RUN_COMMAND_WAITPID_NOEXIT,
1212
};
13-
#define IS_RUN_COMMAND_ERR(x) ((x) <= -ERR_RUN_COMMAND_FORK)
13+
#define IS_RUN_COMMAND_ERR(x) (-(x) >= ERR_RUN_COMMAND_FORK)
1414

1515
struct child_process {
1616
const char **argv;

0 commit comments

Comments
 (0)