summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertise.dev>2020-05-04 23:52:13 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-05-04 23:52:13 -0300
commit3179089b49f45a6f45165e1b7741bb292ef0a127 (patch)
tree86caf9845b2dcf87e234ad87995e61e974fcafec
parentd7fa5eab995958efd90ad63f48cf831c79099107 (diff)
windows: Create basename functiondevs/felipealmeida/fix-eina-dll-export
-rw-r--r--src/lib/eina/eina_module.c7
-rw-r--r--src/lib/eina/eina_str.c2
-rw-r--r--src/lib/evil/evil_basename.c16
-rw-r--r--src/lib/evil/evil_basename.h9
-rw-r--r--src/lib/evil/meson.build1
-rw-r--r--src/lib/evil/unposix/libgen.h7
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 @@
24#include <stdio.h> 24#include <stdio.h>
25#include <sys/types.h> 25#include <sys/types.h>
26#include <string.h> 26#include <string.h>
27#include <libgen.h>
28#include <unistd.h> 27#include <unistd.h>
29 28
30#if defined HAVE_DLOPEN && ! defined _WIN32 29#if defined HAVE_DLOPEN && ! defined _WIN32
@@ -45,6 +44,12 @@
45#include "eina_safety_checks.h" 44#include "eina_safety_checks.h"
46#include "eina_module.h" 45#include "eina_module.h"
47 46
47#ifndef _MSC_VER
48#include <libgen.h>
49#else
50#include <evil_basename.h>
51#endif
52
48/*============================================================================* 53/*============================================================================*
49* Local * 54* Local *
50*============================================================================*/ 55*============================================================================*/
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 @@
28#include <limits.h> 28#include <limits.h>
29#include <ctype.h> 29#include <ctype.h>
30 30
31#include <strings.h>
32
31#ifdef HAVE_BSD_STRING_H 33#ifdef HAVE_BSD_STRING_H
32# include <bsd/string.h> 34# include <bsd/string.h>
33#endif 35#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 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif /* HAVE_CONFIG_H */
4
5#include <evil_api.h>
6
7#include <stdlib.h>
8
9#include <evil_windows.h>
10
11EVIL_API char* basename (char* path)
12{
13 static char base[MAX_PATH];
14 _splitpath_s (path, NULL, 0, NULL, 0, base, MAX_PATH, NULL, 0);
15 return base;
16}
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 @@
1#ifndef __EVIL_BASENAME_H__
2#define __EVIL_BASENAME_H__
3
4#include <evil_api.h>
5
6EVIL_API char* basename (char* path);
7
8#endif
9
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'
15 'evil_unistd.c', 15 'evil_unistd.c',
16 'evil_util.c', 16 'evil_util.c',
17 'evil_private.h', 17 'evil_private.h',
18 'evil_basename.c',
18 'pcre/regex.h', 19 'pcre/regex.h',
19 ] 20 ]
20 21
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 @@
1#ifndef UNPOSIX_LIBGEN_H
2#define UNPOSIX_LIBGEN_H
3
4char *basename(char *);
5char *dirname(char *);
6
7#endif