diff --git a/.gitignore b/.gitignore index 63fd57be..114dd478 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +Makefile *.kdev4 *.o *.a diff --git a/app/localize/start.h b/app/localize/start.h index 1bdd6d04..151e4728 100644 --- a/app/localize/start.h +++ b/app/localize/start.h @@ -97,6 +97,6 @@ #define TXTDOSVERSION "\0$VER: amath 1.60 (01-04-2015)" SPACE TXTARCH #define TXTTITLE "amath version 1.6.0" #define TXTCOPYRIGHT "(c) 2015 Carsten Sonne Larsen" -#define TXTSTARTMSG TXTTITLE SPACE TXTCOPYRIGHT SPACE TXTARCH +#define TXTSTARTMSG TXTTITLE SPACE TXTCOPYRIGHT /******************************************************************************/ #endif diff --git a/app/system/filesystem_stdc.cpp b/app/system/filesystem_stdc.cpp index e7c4515a..843631e9 100755 --- a/app/system/filesystem_stdc.cpp +++ b/app/system/filesystem_stdc.cpp @@ -116,7 +116,14 @@ CharBuffer* StandardFilesystem::ListDirectory(const char *path) CharBuffer* StandardFilesystem::LoadTextFile(const char* name) { - FILE *file = fopen(name, "r"); + FILE *file; + +#if !defined(_WIN32) + file = fopen(name, "r"); +#else + fopen_s(&file, name, "r"); +#endif + if (!file) { return NOMEM; } @@ -150,7 +157,14 @@ CharBuffer* StandardFilesystem::LoadTextFile(const char* name) bool StandardFilesystem::SaveTextFile(const char *name, const char *text) { - FILE *file = fopen(name, "w"); + FILE *file; + +#if !defined(_WIN32) + file = fopen(name, "w"); +#else + fopen_s(&file, name, "w"); +#endif + if (!file) { return false; } diff --git a/app/system/language_stdc.cpp b/app/system/language_stdc.cpp index 3a57a72f..96fda1c0 100644 --- a/app/system/language_stdc.cpp +++ b/app/system/language_stdc.cpp @@ -36,7 +36,7 @@ #include "system/language_stdc.h" StandardLanguage::StandardLanguage() : - Language::Language() + Language() { LoadCatalogs(); } diff --git a/configure b/configure index b02033e1..0eb8962c 100755 --- a/configure +++ b/configure @@ -322,12 +322,18 @@ if $VALID ; then echo " \${FLXCAT} text/help.cd app/localize/help.h=text/help.sd" echo " \${FLXCAT} text/ident-clean.cd app/localize/ident.h=text/ident.sd" echo " \${FLXCAT} text/text.cd app/localize/text.h=text/text.sd" - echo + echo echo "catalogsu: " echo " iconv -f ISO-8859-15 -t UTF-8 catalog/dansk/amath-help.ct >utext/dk-help.dict" echo " iconv -f ISO-8859-15 -t UTF-8 catalog/dansk/amath-ident.ct >utext/dk-ident.dict" echo " iconv -f ISO-8859-15 -t UTF-8 catalog/dansk/amath-text.ct >utext/dk-text.dict" echo " iconv -f ISO-8859-15 -t UTF-8 catalog/dansk/amath-keyword.ct >utext/dk-keyword.dict" + echo + echo "catalogsw: " + echo " iconv -f ISO-8859-15 -t CP850 catalog/dansk/amath-help.ct >utext/dk-help.dict" + echo " iconv -f ISO-8859-15 -t CP850 catalog/dansk/amath-ident.ct >utext/dk-ident.dict" + echo " iconv -f ISO-8859-15 -t CP850 catalog/dansk/amath-text.ct >utext/dk-text.dict" + echo " iconv -f ISO-8859-15 -t CP850 catalog/dansk/amath-keyword.ct >utext/dk-keyword.dict" echo echo "libamathapp: ${libapp}" echo " \${AR} rcs libamathapp${outext}.a ${libapp}" diff --git a/lib/clib/mem.c b/lib/clib/mem.c index a00abea3..d66bb617 100644 --- a/lib/clib/mem.c +++ b/lib/clib/mem.c @@ -37,10 +37,10 @@ #define FREE_MEM(x) FreeVec(x) #define Debug(x,y,z,w) #else -#include -#define ALLOC_MEM(x) calloc(1L,x) -#define FREE_MEM(x) free(x) -#define Debug(x,y,z,w) +# include +# define ALLOC_MEM(x) calloc(1L,x) +# define FREE_MEM(x) free(x) +# define Debug(x,y,z,w) #endif struct MemoryBlock diff --git a/lib/platform.h b/lib/platform.h index 7fba2704..ae9caa5d 100644 --- a/lib/platform.h +++ b/lib/platform.h @@ -155,14 +155,19 @@ inline void operator delete[] (void* ptr) { #endif #endif +#ifdef _WIN32 +# include +# include +#endif + #ifdef __cplusplus #if (__GNUC__ > 2) || defined (_WIN32) #include -inline void* operator new (size_t size) throw(std::bad_alloc) { +inline void* operator new (size_t size) throw() { return AllocMemSafe(size); } -inline void* operator new[] (size_t size) throw(std::bad_alloc) { +inline void* operator new[] (size_t size) throw() { return AllocMemSafe(size); } diff --git a/lib/real/atan2.c b/lib/real/atan2.c index c2d6e4f8..6e0ab341 100644 --- a/lib/real/atan2.c +++ b/lib/real/atan2.c @@ -44,6 +44,10 @@ #include "prim.h" #include "math.h" +#ifdef _WIN32 +#pragma warning( disable : 4146 ) +#endif + /* atan2(y,x) * Method : * 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x). diff --git a/lib/real/atanh.c b/lib/real/atanh.c index f5f40682..e3ce8250 100644 --- a/lib/real/atanh.c +++ b/lib/real/atanh.c @@ -44,6 +44,10 @@ #include "prim.h" #include "math.h" +#ifdef _WIN32 +#pragma warning( disable : 4146 ) +#endif + static const double one = 1.0, huge = 1e300; static double zero = 0.0; diff --git a/lib/real/fmod.c b/lib/real/fmod.c index 4da44b29..46d4a94e 100644 --- a/lib/real/fmod.c +++ b/lib/real/fmod.c @@ -43,6 +43,10 @@ #include "prim.h" +#ifdef _WIN32 +#pragma warning( disable : 4146 ) +#endif + static const double one = 1.0, Zero[] = {0.0, -0.0,}; /**