kmatheussen / jack_capture

A program for recording soundfiles with jack
http://www.notam02.no/arkiv/src/
Other
75 stars 28 forks source link

Fix asprintf declaration #45

Closed kaythomas0 closed 3 years ago

kaythomas0 commented 3 years ago

The declaration of asprintf seems to be causing compilation issues on musl systems (see here). I'm also running into this issue while trying to package this for Alpine Linux. I believe this is because char *fmt isn't being declared as const in the function declaration, and I think it should be (see asprintf man page). This seems to fix the error: conflicting types for asprintf error that gets thrown while trying to compile on a musl system.

kmatheussen commented 3 years ago

Thank you. That fix is fine. The real bug, though, seems to be this line:

kmatheussen commented 3 years ago

Try again:

-#ifndef __USE_GNU
+#ifndef __USE_GNU
kmatheussen commented 3 years ago

(At least according to the man page, "_USE_GNU" should only have one underscore, not two.)

kaythomas0 commented 3 years ago

Ah yeah, good catch!

kmatheussen commented 3 years ago

Actually, I confused USE_GNU and GNU_SOURCE. I guess it's actually two underscores. Anyway, I just defined _GNU_SOURCE and removed the custom asprintf implementation altogether: 00c986d41dc932982d248b7c27221fccaec90f0b