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 +#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 // non-MS win32 compilers (untested) +#endif /*_MSC_VER*/ +#else #include +#define PING_CMD "ping -i 2 -c 10 localhost" // 'slow command' under unix +#endif #include #include #include -#define PING_CMD "ping -i 2 -c 10 localhost" // 'slow command' under unix // GLOBALS FILE *G_fp = NULL;