MINGW-packages/mingw-w64-lame/0007-revert-posix-code.patch
Christoph Reiter e227392981 lame: Update to 3.100 (#3047)
Drop 0001-fix-cr-for-awk-in-configure.mingw.patch:
    patches configure which gets regenerated anyway.
Drop 0003-parallel-builds-fix.all.patch:
    fixed upstream.
Drop 0004-disable-wrong-xmmintrin-detection.all.patch:
    fixed upstream.

0006-dont-use-outdated-symbol-list.patch:
   the export list contains lots of symbols not included by default, just
   ignore it as with 3.99.5

0007-revert-posix-code.patch:
   revert some added posix code, wont work under mingw

0008-skip-termcap.patch:
   For some reason tgetent() crashes under mingw64 (gdb doesn't help)
   just disable for now...
2017-10-15 19:38:02 +03:00

77 lines
2.9 KiB
Diff

--- lame-3.100/frontend/parse.c.orig 2017-10-15 11:49:51.389922000 +0200
+++ lame-3.100/frontend/parse.c 2017-10-15 11:56:02.377439500 +0200
@@ -70,8 +70,6 @@
#ifdef HAVE_ICONV
#include <iconv.h>
#include <errno.h>
-#include <locale.h>
-#include <langinfo.h>
#endif
#if defined _ALLOW_INTERNAL_OPTIONS
@@ -153,7 +151,9 @@
size_t n = 1;
char dst[32];
char* src = "A";
- char* cur_code = nl_langinfo(CODESET);
+ char* env_lang = getenv("LANG");
+ char* xxx_code = env_lang == NULL ? NULL : strrchr(env_lang, '.');
+ char* cur_code = xxx_code == NULL ? "" : xxx_code+1;
iconv_t xiconv = iconv_open(cur_code, "ISO_8859-1");
if (xiconv != (iconv_t)-1) {
for (n = 0; n < 32; ++n) {
@@ -181,7 +181,9 @@
size_t const n = l*4;
dst = calloc(n+4, 4);
if (dst != 0) {
- char* cur_code = nl_langinfo(CODESET);
+ char* env_lang = getenv("LANG");
+ char* xxx_code = env_lang == NULL ? NULL : strrchr(env_lang, '.');
+ char* cur_code = xxx_code == NULL ? "" : xxx_code+1;
iconv_t xiconv = iconv_open(cur_code, "ISO_8859-1");
if (xiconv != (iconv_t)-1) {
char* i_ptr = src;
@@ -205,7 +207,9 @@
size_t const n = l*4;
dst = calloc(n+4, 4);
if (dst != 0) {
- char* cur_code = nl_langinfo(CODESET);
+ char* env_lang = getenv("LANG");
+ char* xxx_code = env_lang == NULL ? NULL : strrchr(env_lang, '.');
+ char* cur_code = xxx_code == NULL ? "" : xxx_code+1;
iconv_t xiconv = iconv_open(cur_code, "UTF-16LE");
if (xiconv != (iconv_t)-1) {
char* i_ptr = (char*)src;
@@ -231,7 +235,9 @@
size_t const n = l*4;
dst = calloc(n+4, 4);
if (dst != 0) {
- char* cur_code = nl_langinfo(CODESET);
+ char* env_lang = getenv("LANG");
+ char* xxx_code = env_lang == NULL ? NULL : strrchr(env_lang, '.');
+ char* cur_code = xxx_code == NULL ? "" : xxx_code+1;
iconv_t xiconv = iconv_open("ISO_8859-1//TRANSLIT", cur_code);
if (xiconv != (iconv_t)-1) {
char* i_ptr = (char*)src;
@@ -257,7 +263,9 @@
size_t const n = (l+1)*4;
dst = calloc(n+4, 4);
if (dst != 0) {
- char* cur_code = nl_langinfo(CODESET);
+ char* env_lang = getenv("LANG");
+ char* xxx_code = env_lang == NULL ? NULL : strrchr(env_lang, '.');
+ char* cur_code = xxx_code == NULL ? "" : xxx_code+1;
iconv_t xiconv = iconv_open("UTF-16LE//TRANSLIT", cur_code);
dst[0] = 0xff;
dst[1] = 0xfe;
@@ -1513,9 +1521,6 @@
enum TextEncoding id3_tenc = TENC_LATIN1;
#endif
-#ifdef HAVE_ICONV
- setlocale(LC_CTYPE, "");
-#endif
inPath[0] = '\0';
outPath[0] = '\0';
/* turn on display options. user settings may turn them off below */