From f3896460d64f06a6203da05bdcdabf7e133c8f10 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sun, 12 Nov 2017 18:00:45 +0000 Subject: Replace chdir() with new wrapper fl_chdir(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12558 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- fluid/fluid.cxx | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'fluid') diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index 39a3f37ab..b75e8f571 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -48,13 +48,6 @@ #include "function_panel.h" #include "template_panel.h" -// Visual C++ 2005 incorrectly displays a warning about the use of -// POSIX APIs on Windows, which is supposed to be POSIX compliant... -// Some of these functions are also defined in ISO C99... -#if defined(_MSC_VER) -# define chdir _chdir -#endif // _MSC_VER - #if defined(WIN32) && !defined(__CYGWIN__) # include # include @@ -135,15 +128,18 @@ void goto_source_dir() { pwd = fl_getcwd(0, FL_PATH_MAX); if (!pwd) {fprintf(stderr, "getwd : %s\n",strerror(errno)); return;} } - if (chdir(buffer) < 0) {fprintf(stderr, "Can't chdir to %s : %s\n", - buffer, strerror(errno)); return;} + if (fl_chdir(buffer) < 0) { + fprintf(stderr, "Can't chdir to %s : %s\n", buffer, strerror(errno)); + return; + } in_source_dir = 1; } void leave_source_dir() { if (!in_source_dir) return; - if (chdir(pwd)<0) {fprintf(stderr, "Can't chdir to %s : %s\n", - pwd, strerror(errno));} + if (fl_chdir(pwd) < 0) { + fprintf(stderr, "Can't chdir to %s : %s\n", pwd, strerror(errno)); + } in_source_dir = 0; } -- cgit v1.2.3