ithewei 6 năm trước cách đây
mục cha
commit
a17ffe6d76
3 tập tin đã thay đổi với 28 bổ sung0 xóa
  1. 8 0
      base/hbase.h
  2. 4 0
      configure
  3. 16 0
      hconfig.h

+ 8 - 0
base/hbase.h

@@ -60,6 +60,14 @@ char* safe_strncpy(char* dest, const char* src, size_t n);
 // safe_strncpy n = sizeof(dest_buf)
 char* safe_strncat(char* dest, const char* src, size_t n);
 
+#if !HAVE_STRLCPY
+#define strlcpy safe_strncpy
+#endif
+
+#if !HAVE_STRLCAT
+#define strlcat safe_strncat
+#endif
+
 // 1 y on yes true enable
 bool getboolean(const char* str);
 

+ 4 - 0
configure

@@ -113,11 +113,15 @@ header=stdint.h && check_header
 header=stdbool.h && check_header
 header=sys/types.h && check_header
 header=sys/stat.h && check_header
+header=sys/time.h && check_header
 header=fcntl.h && check_header
 header=pthread.h && check_header
 
 # Checks for functions
+function=strlcpy && header=string.h && check_funtion
+function=strlcat && header=string.h && check_funtion
 function=clock_gettime && header=time.h && check_funtion
+function=gettimeofday && header=sys/time.h && check_funtion
 
 # end confile
 cat << END >> $confile

+ 16 - 0
hconfig.h

@@ -17,6 +17,10 @@
 #define HAVE_SYS_STAT_H 1
 #endif
 
+#ifndef HAVE_SYS_TIME_H
+#define HAVE_SYS_TIME_H 1
+#endif
+
 #ifndef HAVE_FCNTL_H
 #define HAVE_FCNTL_H 1
 #endif
@@ -25,9 +29,21 @@
 #define HAVE_PTHREAD_H 1
 #endif
 
+#ifndef HAVE_STRLCPY
+#define HAVE_STRLCPY 0
+#endif
+
+#ifndef HAVE_STRLCAT
+#define HAVE_STRLCAT 0
+#endif
+
 #ifndef HAVE_CLOCK_GETTIME
 #define HAVE_CLOCK_GETTIME 1
 #endif
 
+#ifndef HAVE_GETTIMEOFDAY
+#define HAVE_GETTIMEOFDAY 1
+#endif
+
 #endif // HW_CONFIG_H_