Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h memory.c 


Log Message:
Use strdup when available.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -3 -r1.144 -r1.145
--- E.h 8 Nov 2003 23:57:48 -0000       1.144
+++ E.h 9 Nov 2003 19:52:48 -0000       1.145
@@ -38,6 +38,7 @@
 #include <Fnlib.h>
 #endif
 
+#define USE_STRDUP  1
 #define DEBUG_EWMH  0
 
 #define XSync(d, f) \
@@ -2613,7 +2614,11 @@
 __Erealloc(x, y, "<unknown>", 0)
 #endif
 
-char               *duplicate(char *s);
+#if defined(USE_STRDUP) && defined(HAVE_STRDUP)
+#define duplicate(p) ((p) ? strdup(p) : NULL)
+#else
+char               *duplicate(const char *s);
+#endif
 
 void                Alert(char *fmt, ...);
 void                InitStringList(void);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/memory.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -3 -r1.30 -r1.31
--- memory.c    5 Nov 2003 17:24:45 -0000       1.30
+++ memory.c    9 Nov 2003 19:52:48 -0000       1.31
@@ -399,8 +399,9 @@
 }
 #endif
 
+#if !(defined(USE_STRDUP) && defined(HAVE_STRDUP))
 char               *
-duplicate(char *s)
+duplicate(const char *s)
 {
    char               *ss;
    int                 sz;
@@ -413,3 +414,4 @@
    strncpy(ss, s, sz + 1);
    EDBUG_RETURN(ss);
 }
+#endif




-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to