summaryrefslogtreecommitdiff
path: root/src/drivers/WinAPI
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2020-07-21 20:15:41 -0700
committerGreg Ercolano <erco@seriss.com>2020-08-01 14:19:40 -0700
commit2141c63628a831d3f53dad7035c94028f8d0d629 (patch)
tree614cb7b627da2decbb7cfe49c081f9d7b4140c58 /src/drivers/WinAPI
parent7514a73ba759f7fc9965eeef3b92ece899bd7a69 (diff)
Implement + deploy fl_strdup()
Diffstat (limited to 'src/drivers/WinAPI')
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.H3
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
index 91b230d5f..049e6c114 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
+++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
@@ -24,6 +24,7 @@
#include "../../Fl_System_Driver.H"
#include <stdarg.h>
+#include <string.h> // strdup
/*
Move everything here that manages the system interface.
@@ -34,6 +35,7 @@
- directory and file access
- system time and system timer
- multithreading
+ - string management
*/
class Fl_WinAPI_System_Driver : public Fl_System_Driver
@@ -116,6 +118,7 @@ public:
virtual void remove_fd(int, int when);
virtual void remove_fd(int);
virtual void gettime(time_t *sec, int *usec);
+ virtual char* strdup(const char *s) { return ::_strdup(s); }
};
#endif // FL_WINAPI_SYSTEM_DRIVER_H
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
index 592e192e3..d37ec62ff 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
@@ -18,6 +18,7 @@
#include "Fl_WinAPI_System_Driver.H"
#include <FL/Fl.H>
#include <FL/fl_utf8.h>
+#include <FL/fl_string.h> // fl_strdup()
#include <FL/filename.H>
#include <FL/Fl_File_Browser.H>
#include <FL/Fl_File_Icon.H>
@@ -548,7 +549,7 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename
char *newslash; // Directory separator
const char *slash; // Directory separator
char *cwd = 0L, *cwd_buf = 0L;
- if (base) cwd = cwd_buf = strdup(base);
+ if (base) cwd = cwd_buf = fl_strdup(base);
// return if "from" is not an absolute path
if (from[0] == '\0' ||