[MPlayer-users] libmpdemux/asf_mmst_streaming.c compilation problem

Steven M. Schultz sms at 2BSD.COM
Mon Nov 3 07:17:50 CET 2003


On Sun, 2 Nov 2003, Steven M. Schultz wrote:

> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> 
> On Sun, 2 Nov 2003, Steven M. Schultz wrote:
> 
> > cc -c -O4 -march=i686 -mcpu=i686 -pipe -ffast-math -fomit-frame-pointer -D_THREAD_SAFE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I../loader      -o asf_mmst_streaming.o asf_mmst_streaming.c
> > asf_mmst_streaming.c:27: langinfo.h: No such file or directory
> > asf_mmst_streaming.c: In function `string_utf16_open':
> > asf_mmst_streaming.c:117: `CODESET' undeclared (first use in this function)
> > asf_mmst_streaming.c:117: (Each undeclared identifier is reported only once

	Ok, I found the problem.  It's the mixture of POSIX and SUSE 2
	that was causing the problem.   <langinfo.h> and nl_langinfo are
	from SUSE2 but	some systems just have the POSIX setlocale

	The manpages I checked say that nl_langinfo(CODESET) is the
	same thing as setlocale(LC_CTYPE, NULL).

	Is this acceptable?

--- asf_mmst_streaming.c.dist	Sun Nov  2 20:20:23 2003
+++ asf_mmst_streaming.c	Sun Nov  2 22:08:45 2003
@@ -24,7 +24,6 @@
 
 #ifdef USE_ICONV
 #include <locale.h>
-#include <langinfo.h>
 #include <iconv.h>
 #endif
 
@@ -114,7 +113,7 @@
 
 static void string_utf16_open() {
     setlocale(LC_CTYPE, "");
-    url_conv = iconv_open("UTF-16LE",nl_langinfo(CODESET));
+    url_conv = iconv_open("UTF-16LE", setlocale(LC_CTYPE, NULL));
 }
 
 static void string_utf16_close() {

	That obviates the need for my having to use both
	--disable-iconv and --disable-freetype.   The test program I wrote
	(on a RH9 system) worked as expected.

	Steven Schultz



More information about the MPlayer-users mailing list