Index: cpp/common/nonstd.h
===================================================================
--- cpp/common/nonstd.h	(revision 122)
+++ cpp/common/nonstd.h	(revision 123)
@@ -1,2 +1,6 @@
+// This file is a part of the Framsticks GDK.
+// Copyright (C) 2002-2014  Maciej Komosinski and Szymon Ulatowski.  See LICENSE.txt for details.
+// Refer to http://www.framsticks.com/ for further information.
+
 #ifndef _NONSTD_H_
 #define _NONSTD_H_
@@ -18,5 +22,5 @@
 // ms visual c++
 #ifdef _MSC_VER
- #include <stdio.h> //musi byc najpierw ten include zeby robic definy ponizej (albo bedzie '_vsnprintf': attributes inconsistent with previous declaration, stdio.h:358)
+ #include <stdio.h> //this #include must be present before two #defines below can be used, otherwise one will see: '_vsnprintf': attributes inconsistent with previous declaration, stdio.h:358
  #define vsnprintf _vsnprintf
  #define snprintf _snprintf
@@ -48,6 +52,7 @@
 #ifdef LINUX
  #include <strings.h>
- #define stricmp(a,b) strcasecmp(a,b)
- #define _isnan(a) isnan(a) //do nonstd_math.h?
+ #ifndef __CYGWIN__
+  #define stricmp(a,b) strcasecmp(a,b)
+ #endif
 #ifdef INITIAL_DIR_IS_HOME
  #include "cwd.h"
@@ -70,5 +75,4 @@
 #ifdef IPHONE
  #include <string>
- #define _isnan(a) isnan(a) //do nonstd_math.h?
  std::string getAppHome();
  std::string getAppResources();
@@ -78,5 +82,4 @@
 
 #ifdef SHP
- //#define __assert_func(a,b,c,d) 0 //Currently, we are sorry to inform you that assert() is not yet supported. We have considered your request for internal discussion. No ale na szczêcie w³asna (byle by by³a, bo i tak zak³adamy ze assert ktore przeciez dziala tylko w trybie debug nie jest potrzebne na bada) implementacja w "bada-assert.cpp"
  #define GET_APP_HOME "/Home/"
  #define GET_APP_RESOURCES "/Res/"
@@ -100,9 +103,4 @@
 
 
-#ifdef MAIN_FRAMSTICKS
- #define SCRIPTS_DIR GET_APP_RESOURCES "scripts" //katalogi sa na iphone std::string a gdzie indziej "const char*" i to sie wszedzie kompiluje?
-#endif
-
-
 
 //typedef unsigned char boolean; //niestety nie mozna uzyc 'bool' bo VC w rpcndr.h wlasnie tak definiuje booleana, jako unsigned char
Index: cpp/frams/virtfile/virtfile.cpp
===================================================================
--- cpp/frams/virtfile/virtfile.cpp	(revision 122)
+++ cpp/frams/virtfile/virtfile.cpp	(revision 123)
@@ -58,20 +58,26 @@
 int fread(void *ptr, size_t size, size_t nmemb, VirtFILE* f) {return f->Vread(ptr,size,nmemb);}
 int fwrite(const void *ptr, size_t size, size_t nmemb, VirtFILE* f) {return f->Vwrite(ptr,size,nmemb);}
+
+//for some systems, we need to #undef feof which is unfortunately defined as a macro... we have to #undef just to be able to define our own function with this name. Same in virtfile.h
+#if defined __BORLANDC__ || defined _MSC_VER || defined __CYGWIN__ || defined SHP
+ #undef feof
+#endif
+
+int feof(VirtFILE* f) {return f->Veof();}
+
+//...and then restore the original macro:
 #ifdef __BORLANDC__
-#undef feof
+ #define feof(__f)     ((__f)->flags & _F_EOF)
 #endif
 #ifdef _MSC_VER
-#undef feof
+ #define feof(_stream)     ((_stream)->_flag & _IOEOF)
+#endif
+#ifdef __CYGWIN__
+ #define feof(p)  __sfeof(p)
 #endif
 #ifdef SHP
-#undef feof
+ restore original macro... if you ever want to compile this code on bada
 #endif
-int feof(VirtFILE* f) {return f->Veof();}
-#ifdef __BORLANDC__
-#define feof(__f)     ((__f)->flags & _F_EOF)
-#endif
-#ifdef _MSC_VER
-#define feof(_stream)     ((_stream)->_flag & _IOEOF)
-#endif
+
 
 int fputc(int c,VirtFILE* f) {return f->Vputc(c);}
@@ -95,2 +101,3 @@
 int closedir(VirtDIR* d) {delete d; return 0;}
 dirent* readdir(VirtDIR* d) {return d->Vreaddir();}
+
Index: cpp/frams/virtfile/virtfile.h
===================================================================
--- cpp/frams/virtfile/virtfile.h	(revision 122)
+++ cpp/frams/virtfile/virtfile.h	(revision 123)
@@ -70,20 +70,27 @@
 DLLEXP int fread(void *ptr, size_t size, size_t nmemb, VirtFILE* f);
 DLLEXP int fwrite(const void *ptr, size_t size, size_t nmemb, VirtFILE* f);
+
+
+//for some systems, we need to #undef feof which is unfortunately defined as a macro... we have to #undef just to be able to define our own function with this name. Same in virtfile.cpp
+#if defined __BORLANDC__ || defined _MSC_VER || defined __CYGWIN__ || defined SHP
+ #undef feof
+#endif
+ 
+DLLEXP int feof(VirtFILE* f);// {return f->Veof();}
+
+//...and then restore the original macro:
 #ifdef __BORLANDC__
-#undef feof
+ #define feof(__f)     ((__f)->flags & _F_EOF)
 #endif
 #ifdef _MSC_VER
-#undef feof
+ #define feof(_stream)     ((_stream)->_flag & _IOEOF)
+#endif
+#ifdef __CYGWIN__
+ #define feof(p)  __sfeof(p)
 #endif
 #ifdef SHP
-#undef feof //not sure if this is OK since feof() is not defined below for bada, but it won't compile without this #undef. Same in virtfile.cpp
+ restore original macro... if you ever want to compile this code on bada
 #endif
-DLLEXP int feof(VirtFILE* f);// {return f->Veof();}
-#ifdef __BORLANDC__
-#define feof(__f)     ((__f)->flags & _F_EOF)
-#endif
-#ifdef _MSC_VER
-#define feof(_stream)     ((_stream)->_flag & _IOEOF)
-#endif
+
 
 DLLEXP int fputc(int c,VirtFILE* f);
