version 0.3.29
[fms.git] / src / nntp / mime / Mime.cpp
index e79d059..0da5a04 100644 (file)
 #include "../../../include/nntp/mime/Mime.h"\r
 #include <stdlib.h>\r
 #include <time.h>\r
+#include <cstring>\r
+#include <cstdio>\r
+\r
+#ifndef _WIN32\r
+       #define stricmp strcasecmp\r
+       #define strnicmp strncasecmp\r
+       #define memicmp memcmp\r
+#endif\r
 \r
 #ifdef _DEBUG\r
 #undef THIS_FILE\r
@@ -356,7 +364,7 @@ void CMimeHeader::SetBoundary(const char* pszBoundary/*=NULL*/)
        char buf[80];\r
        if (!pszBoundary)                               // generate a new boundary delimeter\r
        {\r
-               ::srand(((unsigned)::time(NULL)) ^ (unsigned)this);\r
+               ::srand(((unsigned)::time(NULL)));// ^ reinterpret_cast<unsigned>(this));\r
                ::sprintf(buf, "__=_Part_Boundary_%03d_%06d.%06d", ++s_nPartNumber, rand(), rand());\r
                if (s_nPartNumber >= 9)\r
                        s_nPartNumber = 0;\r
@@ -464,7 +472,22 @@ list<CMimeField>::iterator CMimeHeader::FindField(const char* pszFieldName)
 #include <fcntl.h>\r
 #include <sys/types.h>\r
 #include <sys/stat.h>\r
-#include <io.h>\r
+\r
+#ifdef _WIN32\r
+       #include <io.h>\r
+#else\r
+       #if !defined(__APPLE__) && !defined(__DARWIN__)\r
+               #if !defined(__FreeBSD__) && !defined(solaris) && !defined(__sun)\r
+                       #include <sys/io.h>\r
+               #else\r
+                       #include <stdio.h>\r
+               #endif\r
+       #endif\r
+#endif\r
+\r
+#ifndef O_BINARY\r
+       #define O_BINARY 0\r
+#endif\r
 \r
 // initialize the content with text\r
 int CMimeBody::SetText(const char* pbText, int nLength/*=0*/)\r