Check for sys/uio.h, net/if_tun.h and net/if_tap.h
[tinc] / lib / xmalloc.c
index 037fab8..e7541bd 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <sys/types.h>
 #include <stdio.h>
+#include <string.h>
 
 #if STDC_HEADERS
 # include <stdlib.h>
@@ -31,15 +32,7 @@ void *realloc ();
 void free ();
 #endif
 
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# define textdomain(Domain)
-# define _(Text) Text
-#endif
-#define N_(Text) Text
-
+#include "gettext.h"
 #include "xalloc.h"
 
 #ifndef EXIT_FAILURE
@@ -124,6 +117,18 @@ xrealloc (p, n)
   return p;
 }
 
+/* Duplicate a string */
+
+char *xstrdup(const char *s)
+{
+  char *p;
+  
+  p = strdup(s);
+  if(!p)
+    xalloc_fail ((int)strlen(s));
+  return p;
+}
+
 #ifdef NOT_USED
 
 /* Allocate memory for N elements of S bytes, with error checking.  */