summaryrefslogtreecommitdiff
path: root/src/filename_list.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2016-02-11 12:02:36 +0000
committerMatthias Melcher <fltk@matthiasm.com>2016-02-11 12:02:36 +0000
commit50ee3bcd66c4baa6bb3388f5b955d726bfc6bdd8 (patch)
tree4b62978d21ee57df7027461b8ea2846c17308d11 /src/filename_list.cxx
parenta3c0dac034c919c2714f3f129a9f5d9d26ae3de4 (diff)
Mark places that need to be refactored with // PORTME:
Searching for __APPLE, WIN32 or X11 did give me many false results. I instead marked most ifdef's that I would like to get rid of with the text // PORTME:, so they can be easily found by a global search. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11155 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/filename_list.cxx')
-rw-r--r--src/filename_list.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/filename_list.cxx b/src/filename_list.cxx
index 920d8b0e6..f27281a59 100644
--- a/src/filename_list.cxx
+++ b/src/filename_list.cxx
@@ -22,12 +22,12 @@
#include <FL/fl_utf8.h>
#include "flstring.h"
#include <stdlib.h>
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: directory stuff
#include <FL/x.H>
#endif
#ifdef WIN32
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) // PORTME: directory stuff
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement directory and filename handling for your platform if needed"
#else // X11
@@ -94,7 +94,7 @@ int fl_filename_list(const char *d, dirent ***list,
// Assume that locale encoding is no less dense than UTF-8
dirlen = strlen(d);
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: directory stuff
dirloc = (char *)d;
#else
dirloc = (char *)malloc(dirlen + 1);
@@ -104,7 +104,7 @@ int fl_filename_list(const char *d, dirent ***list,
#ifndef HAVE_SCANDIR
// This version is when we define our own scandir
int n = fl_scandir(dirloc, list, 0, sort);
-#elif defined(HAVE_SCANDIR_POSIX) && !defined(__APPLE__)
+#elif defined(HAVE_SCANDIR_POSIX) && !defined(__APPLE__) // PORTME: directory stuff
// POSIX (2008) defines the comparison function like this:
int n = scandir(dirloc, list, 0, (int(*)(const dirent **, const dirent **))sort);
#elif defined(__osf__)
@@ -115,7 +115,7 @@ int fl_filename_list(const char *d, dirent ***list,
int n = scandir(dirloc, list, 0, (int(*)(void*, void*))sort);
#elif defined(__sgi)
int n = scandir(dirloc, list, 0, sort);
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) // PORTME: directory stuff
# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
int n = scandir(dirloc, list, 0, (int(*)(const struct dirent**,const struct dirent**))sort);
# else
@@ -131,7 +131,7 @@ int fl_filename_list(const char *d, dirent ***list,
int n = scandir(dirloc, list, 0, (int(*)(const void*,const void*))sort);
#endif
-#ifndef __APPLE__
+#ifndef __APPLE__ // PORTME: directory stuff
free(dirloc);
#endif
@@ -150,7 +150,7 @@ int fl_filename_list(const char *d, dirent ***list,
int newlen;
dirent *de = (*list)[i];
int len = strlen(de->d_name);
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: directory stuff
newlen = len;
#else
newlen = fl_utf8from_mb(NULL, 0, de->d_name, len);
@@ -159,7 +159,7 @@ int fl_filename_list(const char *d, dirent ***list,
// Conversion to UTF-8
memcpy(newde, de, de->d_name - (char*)de);
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: directory stuff
strcpy(newde->d_name, de->d_name);
#else
fl_utf8from_mb(newde->d_name, newlen + 1, de->d_name, len);