From f79b9a26cafa5d04bd201509300ed27bc7a7d61e Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 24 Feb 2021 19:19:17 -0800 Subject: [PATCH] removes Windows strdup redirection Microsoft already provides a shim that does this [0]. [0]: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strdup-wcsdup?view=msvc-160 --- cmd/gvmap/gvmap.c | 3 --- cmd/tools/convert.h | 4 ---- cmd/tools/gml2gv.h | 4 ---- cmd/tools/gv2gml.c | 4 ---- lib/glcomp/glcompdefs.h | 3 --- lib/gvc/gvplugin.c | 4 ---- 6 files changed, 22 deletions(-) diff --git a/cmd/gvmap/gvmap.c b/cmd/gvmap/gvmap.c index 757f08190..44e331bb2 100644 --- a/cmd/gvmap/gvmap.c +++ b/cmd/gvmap/gvmap.c @@ -29,9 +29,6 @@ #include #include -#ifdef _WIN32 -#define strdup(x) _strdup(x) -#endif enum {POINTS_ALL = 1, POINTS_LABEL, POINTS_RANDOM}; enum {maxlen = 10000000}; enum {MAX_GRPS = 10000}; diff --git a/cmd/tools/convert.h b/cmd/tools/convert.h index 22306566c..391efd42f 100644 --- a/cmd/tools/convert.h +++ b/cmd/tools/convert.h @@ -24,10 +24,6 @@ extern "C" { #include #include -#ifdef _WIN32 -#define strdup(x) _strdup(x) -#endif - extern void gv_to_gxl(Agraph_t *, FILE *); #ifdef HAVE_EXPAT extern Agraph_t *gxl_to_gv(FILE *); diff --git a/cmd/tools/gml2gv.h b/cmd/tools/gml2gv.h index 358ad1ad9..724454065 100644 --- a/cmd/tools/gml2gv.h +++ b/cmd/tools/gml2gv.h @@ -1,10 +1,6 @@ #include #include -#ifdef _WIN32 -#define strdup(x) _strdup(x) -#endif - typedef struct { Dtlink_t link; unsigned short kind; diff --git a/cmd/tools/gv2gml.c b/cmd/tools/gv2gml.c index 27aa9935f..37c716c1b 100644 --- a/cmd/tools/gv2gml.c +++ b/cmd/tools/gv2gml.c @@ -118,11 +118,7 @@ parseStyle (char* s) char* ip; char* sep = " \t,"; -#ifdef _WIN32 - s = _strdup(s); -#else s = strdup(s); -#endif for (ip = strtok (s, sep); ip; ip = strtok (NULL, sep)) { if (streq(ip,"invis")) flags |= INVIS; else if (streq(ip,"filled")) flags |= FILL; diff --git a/lib/glcomp/glcompdefs.h b/lib/glcomp/glcompdefs.h index 7dc2f99ec..44872905f 100644 --- a/lib/glcomp/glcompdefs.h +++ b/lib/glcomp/glcompdefs.h @@ -25,9 +25,6 @@ #include #include #include -#ifdef _WIN32 -#define strdup _strdup -#endif #ifdef __cplusplus extern "C" { diff --git a/lib/gvc/gvplugin.c b/lib/gvc/gvplugin.c index f802f1ce5..f4383c19c 100644 --- a/lib/gvc/gvplugin.c +++ b/lib/gvc/gvplugin.c @@ -36,10 +36,6 @@ #include #include -#ifdef _WIN32 -#define strdup(x) _strdup(x) -#endif - /* * Define an apis array of name strings using an enumerated api_t as index. * The enumerated type is defined gvplugin.h. The apis array is -- 2.40.0