Skip to content

Commit

Permalink
Define fallback PATH_MAX on systems that do not define one in <limits.h>
Browse files Browse the repository at this point in the history
Notably on GNU/Hurd, as reported by Gerrit Pape.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Sep 16, 2006
1 parent 17fd965 commit d0c2449
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions builtin.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#ifndef BUILTIN_H
#define BUILTIN_H

#include <stdio.h>
#include <limits.h>
#include "git-compat-util.h"

extern const char git_version_string[];
extern const char git_usage_string[];
Expand Down
7 changes: 7 additions & 0 deletions git-compat-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
#include <sys/types.h>
#include <dirent.h>

/* On most systems <limits.h> would have given us this, but
* not on some systems (e.g. GNU/Hurd).
*/
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif

#ifdef __GNUC__
#define NORETURN __attribute__((__noreturn__))
#else
Expand Down

0 comments on commit d0c2449

Please sign in to comment.