Skip to content

Commit

Permalink
fix portability problem with IS_RUN_COMMAND_ERR
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Apr 1, 2009
1 parent bf63780 commit fd94836
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion run-command.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enum {
ERR_RUN_COMMAND_WAITPID_SIGNAL,
ERR_RUN_COMMAND_WAITPID_NOEXIT,
};
#define IS_RUN_COMMAND_ERR(x) ((x) <= -ERR_RUN_COMMAND_FORK)
#define IS_RUN_COMMAND_ERR(x) (-(x) >= ERR_RUN_COMMAND_FORK)

struct child_process {
const char **argv;
Expand Down

0 comments on commit fd94836

Please sign in to comment.