diff options
author | pixel <pixel> | 2002-12-23 20:49:18 +0000 |
---|---|---|
committer | pixel <pixel> | 2002-12-23 20:49:18 +0000 |
commit | c918391887c08d5ab4874daa5267401c08d6563a (patch) | |
tree | cd2e362455f14e6bbca93f2e8c984f3ce50f4d78 | |
parent | 9ba3c9416d45e5c53c8e7f83638d3bfba22520d4 (diff) |
VC6 is definitively a broken compiler...
-rw-r--r-- | lib/Exceptions.cc | 2 | ||||
-rw-r--r-- | lib/Image.cc | 4 | ||||
-rw-r--r-- | lib/Input.cc | 5 |
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/Exceptions.cc b/lib/Exceptions.cc index 1ff8b6a..e9c5861 100644 --- a/lib/Exceptions.cc +++ b/lib/Exceptions.cc @@ -124,11 +124,13 @@ void * xrealloc(void * ptr, size_t s) { void xfree(unsigned char *& p) { char * t = (char *) p; xfree(t); + p = 0; } void xfree(void *& p) { char * t = (char *) p; xfree(t); + p = 0; } void xfree(char *& p) { diff --git a/lib/Image.cc b/lib/Image.cc index ad986f6..2e33da7 100644 --- a/lib/Image.cc +++ b/lib/Image.cc @@ -9,7 +9,9 @@ Image::Image(unsigned int ax, unsigned int ay) : x(ax), y(ay), img((Color *) mal } Image::~Image() { - free((void *)img); + char * t = (char *) img; + free(t); + img = 0; } bool Image::CanWrite() const { diff --git a/lib/Input.cc b/lib/Input.cc index 719c560..c7cd1d9 100644 --- a/lib/Input.cc +++ b/lib/Input.cc @@ -7,6 +7,11 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#else +#include <io.h> +#endif #include "Input.h" #include "Exceptions.h" #include "gettext.h" |