File libtunepimp-fixes.patch of Package libtunepimp

Index: libtunepimp-0.5.3/lib/utf8/utf8util.cpp
===================================================================
--- libtunepimp-0.5.3.orig/lib/utf8/utf8util.cpp
+++ libtunepimp-0.5.3/lib/utf8/utf8util.cpp
@@ -26,6 +26,7 @@
 ----------------------------------------------------------------------------*/
 
 #include <stdio.h>
+#include <cstdlib>
 #include "utf8util.h"
 #include "utf8.h"
 #ifdef WIN32
Index: libtunepimp-0.5.3/include/tunepimp-0.5/metadata.h
===================================================================
--- libtunepimp-0.5.3.orig/include/tunepimp-0.5/metadata.h
+++ libtunepimp-0.5.3/include/tunepimp-0.5/metadata.h
@@ -28,6 +28,7 @@
 #define __METADATA_H__
 
 #include <string>
+#include <cstring>
 #include <cstdio>
 
 #include "defs.h"
Index: libtunepimp-0.5.3/lib/metadata.cpp
===================================================================
--- libtunepimp-0.5.3.orig/lib/metadata.cpp
+++ libtunepimp-0.5.3/lib/metadata.cpp
@@ -25,6 +25,7 @@
 
 ----------------------------------------------------------------------------*/
 #include <math.h>
+#include <cstdlib>
 #include <stdio.h>
 #include "metadata.h"
 #include "../config.h"
Index: libtunepimp-0.5.3/lib/protocol.cpp
===================================================================
--- libtunepimp-0.5.3.orig/lib/protocol.cpp
+++ libtunepimp-0.5.3/lib/protocol.cpp
@@ -9,6 +9,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string>
+#include <cstring>
 #include <map>
 #include <expat.h>
 #include <curl/curl.h>
Index: libtunepimp-0.5.3/lib/tunepimp.cpp
===================================================================
--- libtunepimp-0.5.3.orig/lib/tunepimp.cpp
+++ libtunepimp-0.5.3/lib/tunepimp.cpp
@@ -32,6 +32,7 @@
 
 #include <stdio.h>
 #include <map>
+#include <cstdlib>
 using namespace std;
 
 #ifdef WIN32
Index: libtunepimp-0.5.3/lib/c_wrapper.cpp
===================================================================
--- libtunepimp-0.5.3.orig/lib/c_wrapper.cpp
+++ libtunepimp-0.5.3/lib/c_wrapper.cpp
@@ -28,6 +28,7 @@
 #include "mutex.h"
 #include "tp_c.h"
 #include "astrcmp.h"
+#include <cstdlib>
 
 #define DB printf("%s:%d\n", __FILE__, __LINE__);
 
Index: libtunepimp-0.5.3/lib/readmeta.cpp
===================================================================
--- libtunepimp-0.5.3.orig/lib/readmeta.cpp
+++ libtunepimp-0.5.3/lib/readmeta.cpp
@@ -31,6 +31,7 @@
 #endif
 
 #include <stdio.h>
+#include <cstdlib>
 #ifndef WIN32
 #include <unistd.h>
 #endif
Index: libtunepimp-0.5.3/lib/fileio.cpp
===================================================================
--- libtunepimp-0.5.3.orig/lib/fileio.cpp
+++ libtunepimp-0.5.3/lib/fileio.cpp
@@ -28,6 +28,8 @@
 #include <assert.h>
 #include <errno.h>
 #include <string>
+#include <cstring>
+#include <cstdlib>
 #ifndef WIN32
 #include <unistd.h>
 #endif
@@ -122,9 +124,9 @@ int taccess(const char *pathname, int mo
 
 void tmktempname(const char *path, char *newPath, int newPathLen)
 {
-    char *ptr, *temp;
+    const char *ptr; 
 
-    temp = (char *)malloc(strlen(path) + 32);
+    char *temp = (char *)malloc(strlen(path) + 32);
     ptr = strrchr(path, dirSepChar);
     if (ptr)
     {
Index: libtunepimp-0.5.3/plugins/wma/wmafile.cpp
===================================================================
--- libtunepimp-0.5.3.orig/plugins/wma/wmafile.cpp
+++ libtunepimp-0.5.3/plugins/wma/wmafile.cpp
@@ -20,6 +20,7 @@
  ***************************************************************************/
 
 #include <tstring.h>
+#include <cstring>
 #include <wmafile.h>
 #include <wmatag.h>
 #include <wmaproperties.h>
Index: libtunepimp-0.5.3/plugins/wma/wma.cpp
===================================================================
--- libtunepimp-0.5.3.orig/plugins/wma/wma.cpp
+++ libtunepimp-0.5.3/plugins/wma/wma.cpp
@@ -27,6 +27,7 @@
 
 #include <string.h>
 #include <stdio.h>
+#include <cstdlib>
 #include <wmafile.h>
 #include "metadata.h"
 #include "plugin.h"