diff options
author | Felipe Magno de Almeida <felipe@expertise.dev> | 2020-05-04 23:52:13 -0300 |
---|---|---|
committer | Felipe Magno de Almeida <felipe@expertise.dev> | 2020-05-04 23:52:13 -0300 |
commit | 3179089b49f45a6f45165e1b7741bb292ef0a127 (patch) | |
tree | 86caf9845b2dcf87e234ad87995e61e974fcafec | |
parent | d7fa5eab995958efd90ad63f48cf831c79099107 (diff) | |
download | efl-devs/felipealmeida/fix-eina-dll-export.tar.gz |
windows: Create basename functiondevs/felipealmeida/fix-eina-dll-export
-rw-r--r-- | src/lib/eina/eina_module.c | 7 | ||||
-rw-r--r-- | src/lib/eina/eina_str.c | 2 | ||||
-rw-r--r-- | src/lib/evil/evil_basename.c | 16 | ||||
-rw-r--r-- | src/lib/evil/evil_basename.h | 9 | ||||
-rw-r--r-- | src/lib/evil/meson.build | 1 | ||||
-rw-r--r-- | src/lib/evil/unposix/libgen.h | 7 |
6 files changed, 34 insertions, 8 deletions
diff --git a/src/lib/eina/eina_module.c b/src/lib/eina/eina_module.c index 15d1d618ca..8e5dfa0f72 100644 --- a/src/lib/eina/eina_module.c +++ b/src/lib/eina/eina_module.c @@ -24,7 +24,6 @@ #include <stdio.h> #include <sys/types.h> #include <string.h> -#include <libgen.h> #include <unistd.h> #if defined HAVE_DLOPEN && ! defined _WIN32 @@ -45,6 +44,12 @@ #include "eina_safety_checks.h" #include "eina_module.h" +#ifndef _MSC_VER +#include <libgen.h> +#else +#include <evil_basename.h> +#endif + /*============================================================================* * Local * *============================================================================*/ diff --git a/src/lib/eina/eina_str.c b/src/lib/eina/eina_str.c index 4b7f2c9ce3..e5d550922d 100644 --- a/src/lib/eina/eina_str.c +++ b/src/lib/eina/eina_str.c @@ -28,6 +28,8 @@ #include <limits.h> #include <ctype.h> +#include <strings.h> + #ifdef HAVE_BSD_STRING_H # include <bsd/string.h> #endif diff --git a/src/lib/evil/evil_basename.c b/src/lib/evil/evil_basename.c new file mode 100644 index 0000000000..8e51910749 --- /dev/null +++ b/src/lib/evil/evil_basename.c @@ -0,0 +1,16 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif /* HAVE_CONFIG_H */ + +#include <evil_api.h> + +#include <stdlib.h> + +#include <evil_windows.h> + +EVIL_API char* basename (char* path) +{ + static char base[MAX_PATH]; + _splitpath_s (path, NULL, 0, NULL, 0, base, MAX_PATH, NULL, 0); + return base; +} diff --git a/src/lib/evil/evil_basename.h b/src/lib/evil/evil_basename.h new file mode 100644 index 0000000000..a92c5d35dd --- /dev/null +++ b/src/lib/evil/evil_basename.h @@ -0,0 +1,9 @@ +#ifndef __EVIL_BASENAME_H__ +#define __EVIL_BASENAME_H__ + +#include <evil_api.h> + +EVIL_API char* basename (char* path); + +#endif + diff --git a/src/lib/evil/meson.build b/src/lib/evil/meson.build index 52e37971cd..d9bef68e64 100644 --- a/src/lib/evil/meson.build +++ b/src/lib/evil/meson.build @@ -15,6 +15,7 @@ if target_machine.system() == 'windows' 'evil_unistd.c', 'evil_util.c', 'evil_private.h', + 'evil_basename.c', 'pcre/regex.h', ] diff --git a/src/lib/evil/unposix/libgen.h b/src/lib/evil/unposix/libgen.h deleted file mode 100644 index 819bb33d39..0000000000 --- a/src/lib/evil/unposix/libgen.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef UNPOSIX_LIBGEN_H -#define UNPOSIX_LIBGEN_H - -char *basename(char *); -char *dirname(char *); - -#endif |