/
flac-1.2.1.patch
58 lines (56 loc) · 2.43 KB
/
flac-1.2.1.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
diff -ruN flac-1.2.1/configure flac-1.2.1.new/configure
--- flac-1.2.1/configure 2007-09-16 13:05:33.000000000 -0700
+++ flac-1.2.1.new/configure 2013-05-29 22:59:33.000000000 -0700
@@ -6845,7 +6845,8 @@
# _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
# as there is no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
- allow_undefined_flag=unsupported
+ # The FLAC build trips the undefined symbols path for some reason, even though it links successfully.
+ #allow_undefined_flag=unsupported
always_export_symbols=no
enable_shared_with_static_runtimes=yes
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
diff -ruN flac-1.2.1/examples/cpp/encode/file/main.cpp flac-1.2.1.new/examples/cpp/encode/file/main.cpp
--- flac-1.2.1/examples/cpp/encode/file/main.cpp 2007-09-13 08:58:03.000000000 -0700
+++ flac-1.2.1.new/examples/cpp/encode/file/main.cpp 2013-05-29 22:59:33.000000000 -0700
@@ -30,6 +30,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "FLAC++/metadata.h"
#include "FLAC++/encoder.h"
diff -ruN flac-1.2.1/src/libFLAC/bitreader.c flac-1.2.1.new/src/libFLAC/bitreader.c
--- flac-1.2.1/src/libFLAC/bitreader.c 2007-09-10 21:48:55.000000000 -0700
+++ flac-1.2.1.new/src/libFLAC/bitreader.c 2013-05-29 22:59:33.000000000 -0700
@@ -40,7 +40,12 @@
#elif defined FLAC__SYS_DARWIN
#include <machine/endian.h> /* for ntohl() */
#elif defined __MINGW32__
-#include <winsock.h> /* for ntohl() */
+//#include <winsock.h> /* for ntohl() */
+static inline unsigned int ntohl(unsigned int x)
+{
+ __asm__("bswap %0": "=r"(x):"0"(x));
+ return x;
+}
#else
#include <netinet/in.h> /* for ntohl() */
#endif
diff -ruN flac-1.2.1/src/libFLAC/bitwriter.c flac-1.2.1.new/src/libFLAC/bitwriter.c
--- flac-1.2.1/src/libFLAC/bitwriter.c 2007-09-10 16:08:38.000000000 -0700
+++ flac-1.2.1.new/src/libFLAC/bitwriter.c 2013-05-29 22:59:33.000000000 -0700
@@ -40,7 +40,12 @@
#elif defined FLAC__SYS_DARWIN
#include <machine/endian.h> /* for ntohl() */
#elif defined __MINGW32__
-#include <winsock.h> /* for ntohl() */
+//#include <winsock.h> /* for ntohl() */
+static inline unsigned int ntohl(unsigned int x)
+{
+ __asm__("bswap %0": "=r"(x):"0"(x));
+ return x;
+}
#else
#include <netinet/in.h> /* for ntohl() */
#endif