clean up and support missing locale

This commit is contained in:
Vítor Santos Costa
2014-03-15 22:29:04 +00:00
parent 6d2e2597b1
commit 5491abdeeb
3 changed files with 18 additions and 9 deletions

View File

@@ -57,7 +57,9 @@ locking is required.
#endif
#define PL_KERNEL 1
#if HAVE_LOCALE_H && HAVE_SETLOCALE
#define O_LOCALE 1
#endif
#include <wchar.h>
#define NEEDS_SWINSOCK
#include "SWI-Stream.h"
@@ -1800,8 +1802,10 @@ Sclose(IOSTREAM *s)
if ( s->message )
free(s->message);
#if O_LOCALE
if ( s->locale )
releaseLocale(s->locale);
#endif
if ( s->references == 0 )
unallocStream(s);
else