summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2011-01-04 02:05:56 +0000
committerGreg Ercolano <erco@seriss.com>2011-01-04 02:05:56 +0000
commite4b4ecb53d30d8ff3d885385760029d66fcc524e (patch)
tree354e86e3a96e4fc5f935d34698256f343f7fc371 /examples
parent210114ca0fb9e77cbcd6f30aa4188bf4f841508c (diff)
Mods to allow building on Windows.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8177 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'examples')
-rw-r--r--examples/howto-add_fd-and-popen.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/howto-add_fd-and-popen.cxx b/examples/howto-add_fd-and-popen.cxx
index c1f7df315..ef7e07bba 100644
--- a/examples/howto-add_fd-and-popen.cxx
+++ b/examples/howto-add_fd-and-popen.cxx
@@ -32,12 +32,22 @@
// http://www.fltk.org/str.php
//
#include <stdio.h>
+#ifdef _WIN32
+#define PING_CMD "ping -n 10 localhost" // 'slow command' under windows
+#ifdef _MSC_VER
+#define popen _popen
+#define pclose _pclose
+#else /*_MSC_VER*/
+#include <unistd.h> // non-MS win32 compilers (untested)
+#endif /*_MSC_VER*/
+#else
#include <unistd.h>
+#define PING_CMD "ping -i 2 -c 10 localhost" // 'slow command' under unix
+#endif
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Multi_Browser.H>
-#define PING_CMD "ping -i 2 -c 10 localhost" // 'slow command' under unix
// GLOBALS
FILE *G_fp = NULL;