Merge branch 'jt/itimer-autoconf'
authorJunio C Hamano <gitster@pobox.com>
Tue, 30 Sep 2014 05:17:23 +0000 (22:17 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Sep 2014 05:17:24 +0000 (22:17 -0700)
setitmer(2) and related API elements can be configured from
Makefile but autoconf did not know about it.

* jt/itimer-autoconf:
autoconf: check for setitimer()
autoconf: check for struct itimerval
git-compat-util.h: add missing semicolon after struct itimerval

1  2 
git-compat-util.h
diff --combined git-compat-util.h
index 0c4e663928cb8fb03c73a6d3de6a506c7d98fc9a,f7fae2060771ba62b33dec67c72253517e880a3a..fb41118c0705c628bed093c4a915a58aa01a5a1a
@@@ -82,7 -82,6 +82,7 @@@
  #define _ALL_SOURCE 1
  #define _GNU_SOURCE 1
  #define _BSD_SOURCE 1
 +#define _DEFAULT_SOURCE 1
  #define _NETBSD_SOURCE 1
  #define _SGI_SOURCE 1
  
@@@ -192,7 -191,7 +192,7 @@@ extern int compat_mkdir_wo_trailing_sla
  struct itimerval {
        struct timeval it_interval;
        struct timeval it_value;
- }
+ };
  #endif
  
  #ifdef NO_SETITIMER
@@@ -265,35 -264,19 +265,35 @@@ extern char *gitbasename(char *)
  #endif
  
  #ifndef has_dos_drive_prefix
 -#define has_dos_drive_prefix(path) 0
 +static inline int git_has_dos_drive_prefix(const char *path)
 +{
 +      return 0;
 +}
 +#define has_dos_drive_prefix git_has_dos_drive_prefix
  #endif
  
 -#ifndef offset_1st_component
 -#define offset_1st_component(path) (is_dir_sep((path)[0]))
 +#ifndef is_dir_sep
 +static inline int git_is_dir_sep(int c)
 +{
 +      return c == '/';
 +}
 +#define is_dir_sep git_is_dir_sep
  #endif
  
 -#ifndef is_dir_sep
 -#define is_dir_sep(c) ((c) == '/')
 +#ifndef offset_1st_component
 +static inline int git_offset_1st_component(const char *path)
 +{
 +      return is_dir_sep(path[0]);
 +}
 +#define offset_1st_component git_offset_1st_component
  #endif
  
  #ifndef find_last_dir_sep
 -#define find_last_dir_sep(path) strrchr(path, '/')
 +static inline char *git_find_last_dir_sep(const char *path)
 +{
 +      return strrchr(path, '/');
 +}
 +#define find_last_dir_sep git_find_last_dir_sep
  #endif
  
  #if defined(__HP_cc) && (__HP_cc >= 61000)
@@@ -610,7 -593,6 +610,7 @@@ extern try_to_free_t set_try_to_free_ro
  extern char *xstrdup(const char *str);
  extern void *xmalloc(size_t size);
  extern void *xmallocz(size_t size);
 +extern void *xmallocz_gently(size_t size);
  extern void *xmemdupz(const void *data, size_t len);
  extern char *xstrndup(const char *str, size_t len);
  extern void *xrealloc(void *ptr, size_t size);
@@@ -625,9 -607,6 +625,9 @@@ extern int xmkstemp(char *template)
  extern int xmkstemp_mode(char *template, int mode);
  extern int odb_mkstemp(char *template, size_t limit, const char *pattern);
  extern int odb_pack_keep(char *name, size_t namesz, const unsigned char *sha1);
 +extern char *xgetcwd(void);
 +
 +#define REALLOC_ARRAY(x, alloc) (x) = xrealloc((x), (alloc) * sizeof(*(x)))
  
  static inline size_t xsize_t(off_t len)
  {