Closed cecton closed 8 years ago
I planned to remove memory.h/malloc.h from VGMPlay during a rewrite, actually. The optimal solution is: memory.h -> string.h, malloc.h -> stdlib.h Then you don't need any #ifdef. (All functions of memory.h/malloc.h are already part of stdlib.h/string.h. Using the former ones was just a bad habit of mine.)
Feel free to add wchar.h.
Okay for the wchar.h
.
About the malloc.h
I already have the solution with the ifdef
. Do you plan to rewrite it entirely? Then I guess it's okay to apply my fix as a temporary fix for OSX users. What do you think?
Well you don't really need the extra #ifdef, since the whole malloc.h include is redundant, you can just get rid of it and use stdlib.h
On Wed, Mar 23, 2016 at 5:24 PM, Cecile Tonglet notifications@github.com wrote:
Okay for the wchar.h.
About the malloc.h I already have the solution with the ifdef. Do you plan to rewrite it entirely? Then I guess it's okay to apply my fix as a temporary fix for OSX users. What do you think?
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/vgmrips/vgmplay/issues/21#issuecomment-200421750
Sorry, I've not been clear. Instead of adding #ifdefs
, just replace malloc.h
with stdlib.h
.
That's a clean solution and makes the code more portable.
(I wanted to rewrite VGMPlay someday and fix such issues, which is why I haven't fixed it here. But I didn't get too far yet.)
Okay I get it :) I'll do that.
Hello,
I would like to make a PR to fix some issues but, since I'm not an expert in C, I would like to know if my solutions work for you (but maybe you don't mind since you've planned to re-write it all anyway...)
#include <malloc.h>
by#include <sys/malloc.h>
. Is it okay if I fix it with a conditional#ifdef MACOSX
?#include <wchar.h>
inStream.c
. Is it okay if I simply add this include inStream.c
? It works normally in gcc.Thanks