diff --git a/src/common.h b/src/common.h
index 4aced6f1..06e25555 100644
--- a/src/common.h
+++ b/src/common.h
@@ -125,7 +125,7 @@ void __inline CLIB_DECL D_(const char *text, ...) { do {} while (0); }
 #ifdef _MSC_VER
 #define dup _dup
 #define fileno _fileno
-#define snprintf _snprintf
+/* #define snprintf _snprintf */
 #define vsnprintf _vsnprintf
 #define strnicmp _strnicmp
 #define strdup _strdup
diff --git a/src/load.c b/src/load.c
index b017d957..d03fcd1a 100644
--- a/src/load.c
+++ b/src/load.c
@@ -34,7 +34,6 @@
 #include "format.h"
 #include "list.h"
 #include "hio.h"
-#include "tempfile.h"
 
 #ifndef LIBXMP_CORE_PLAYER
 #if !defined(HAVE_POPEN) && defined(WIN32)
@@ -152,9 +151,6 @@ int xmp_test_module(char *path, struct xmp_test_info *info)
 	char buf[XMP_NAME_SIZE];
 	int i;
 	int ret = -XMP_ERROR_FORMAT;
-#ifndef LIBXMP_CORE_PLAYER
-	char *temp = NULL;
-#endif
 
 	if (stat(path, &st) < 0)
 		return -XMP_ERROR_SYSTEM;
@@ -181,10 +177,6 @@ int xmp_test_module(char *path, struct xmp_test_info *info)
 
 			fclose(h->handle.file);
 
-#ifndef LIBXMP_CORE_PLAYER
-			unlink_temp_file(temp);
-#endif
-
 			if (info != NULL && !is_prowizard) {
 				strncpy(info->name, buf, XMP_NAME_SIZE - 1);
 				strncpy(info->type, format_loader[i]->name,
@@ -197,7 +189,6 @@ int xmp_test_module(char *path, struct xmp_test_info *info)
 #ifndef LIBXMP_CORE_PLAYER
     err:
 	hio_close(h);
-	unlink_temp_file(temp);
 #else
 	hio_close(h);
 #endif
@@ -312,7 +303,6 @@ int xmp_load_module(xmp_context opaque, char *path)
 #ifndef LIBXMP_CORE_PLAYER
 	struct module_data *m = &ctx->m;
 	long size;
-	char *temp_name;
 #endif
 	HIO_HANDLE *h;
 	struct stat st;
@@ -358,16 +348,11 @@ int xmp_load_module(xmp_context opaque, char *path)
 	ret = load_module(opaque, h);
 	hio_close(h);
 
-#ifndef LIBXMP_CORE_PLAYER
-	unlink_temp_file(temp_name);
-#endif
-
 	return ret;
 
 #ifndef LIBXMP_CORE_PLAYER
     err:
 	hio_close(h);
-	unlink_temp_file(temp_name);
 	return ret;
 #endif
 }
diff --git a/src/tempfile.c b/src/tempfile.c
deleted file mode 100644
index ad204e82..00000000
--- a/src/tempfile.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* Extended Module Player
- * Copyright (C) 1996-2016 Claudio Matsuoka and Hipolito Carraro Jr
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifdef __SUNPRO_C
-#pragma error_messages (off,E_EMPTY_TRANSLATION_UNIT)
-#endif
-
-#ifndef LIBXMP_CORE_PLAYER
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <unistd.h>
-
-#ifdef HAVE_UMASK
-#include <sys/stat.h>
-#endif
-
-#include "tempfile.h"
-
-#ifdef WIN32
-
-int mkstemp(char *);
-
-static int get_temp_dir(char *buf, int size)
-{
-	const char def[] = "C:\\WINDOWS\\TEMP";
-	char *tmp = getenv("TEMP");
-
-	strncpy(buf, tmp ? tmp : def, size);
-	strncat(buf, "\\", size);
-
-	return 0;
-}
-
-#elif defined __AMIGA__
-
-static int get_temp_dir(char *buf, int size)
-{
-	strncpy(buf, "T:", size);
-	return 0;
-}
-
-#elif defined __ANDROID__
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-static int get_temp_dir(char *buf, int size)
-{
-#define APPDIR "/sdcard/Xmp for Android"
-	struct stat st;
-	if (stat(APPDIR, &st) < 0) {
-		if (mkdir(APPDIR, 0777) < 0)
-			return -1;
-	}
-	if (stat(APPDIR "/tmp", &st) < 0) {
-		if (mkdir(APPDIR "/tmp", 0777) < 0)
-			return -1;
-	}
-	strncpy(buf, APPDIR "/tmp/", size);
-
-	return 0;
-}
-
-#else
-
-static int get_temp_dir(char *buf, int size)
-{
-	char *tmp = getenv("TMPDIR");
-
-	if (tmp) {
-		snprintf(buf, size, "%s/", tmp);
-	} else {
-		strncpy(buf, "/tmp/", size);
-	}
-
-	return 0;
-}
-
-#endif
-
-
-FILE *make_temp_file(char **filename) {
-	char tmp[PATH_MAX];
-	FILE *temp;
-	int fd;
-
-	if (get_temp_dir(tmp, PATH_MAX) < 0)
-		return NULL;
-
-	strncat(tmp, "xmp_XXXXXX", PATH_MAX - 10);
-
-	if ((*filename = strdup(tmp)) == NULL)
-		goto err;
-
-#ifdef HAVE_UMASK
-	umask(0177);
-#endif
-	if ((fd = mkstemp(*filename)) < 0)
-		goto err2;
-
-	if ((temp = fdopen(fd, "w+b")) == NULL)
-		goto err3;
-
-	return temp;
-
-    err3:
-	close(fd);
-    err2:
-	free(*filename);
-    err:
-	return NULL;
-}
-
-/*
- * Windows doesn't allow you to unlink an open file, so we changed the
- * temp file cleanup system to remove temporary files after we close it
- */
-void unlink_temp_file(char *temp)
-{
-	if (temp) {
-		unlink(temp);
-		free(temp);
-	}
-}
-
-#endif
diff --git a/src/tempfile.h b/src/tempfile.h
deleted file mode 100644
index f3c8f77d..00000000
--- a/src/tempfile.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef XMP_PLATFORM_H
-#define XMP_PLATFORM_H
-
-FILE *make_temp_file(char **);
-void unlink_temp_file(char *);
-
-#endif
