Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: src/libFLAC/include/private/macros.h

Issue 1961133002: Update FLAC to 1.3.1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/flac.git@master
Patch Set: build config tweaks for Windows Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/libFLAC/include/private/lpc.h ('k') | src/libFLAC/include/private/md5.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/libFLAC/include/private/macros.h
diff --git a/src/libFLAC/include/protected/stream_decoder.h b/src/libFLAC/include/private/macros.h
similarity index 61%
copy from src/libFLAC/include/protected/stream_decoder.h
copy to src/libFLAC/include/private/macros.h
index 9108ca78f225c062965a599f661d8b0199cc9e9f..0eed2d3381bad47d3a4f7c6c5068f60d77553106 100644
--- a/src/libFLAC/include/protected/stream_decoder.h
+++ b/src/libFLAC/include/private/macros.h
@@ -1,5 +1,5 @@
/* libFLAC - Free Lossless Audio Codec library
- * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
+ * Copyright (C) 2012-2014 Xiph.org Foundation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,30 +29,44 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FLAC__PROTECTED__STREAM_DECODER_H
-#define FLAC__PROTECTED__STREAM_DECODER_H
+#ifndef FLAC__PRIVATE__MACROS_H
+#define FLAC__PRIVATE__MACROS_H
-#include "FLAC/stream_decoder.h"
-#if FLAC__HAS_OGG
-#include "private/ogg_decoder_aspect.h"
+#if defined(__GNUC__)
+
+#define flac_max(a,b) \
+ ({ __typeof__ (a) _a = (a); \
+ __typeof__ (b) _b = (b); \
+ _a > _b ? _a : _b; })
+
+#define MIN_PASTE(A,B) A##B
+#define MIN_IMPL(A,B,L) ({ \
+ __typeof__(A) MIN_PASTE(__a,L) = (A); \
+ __typeof__(B) MIN_PASTE(__b,L) = (B); \
+ MIN_PASTE(__a,L) < MIN_PASTE(__b,L) ? MIN_PASTE(__a,L) : MIN_PASTE(__b,L); \
+ })
+
+#define flac_min(A,B) MIN_IMPL(A,B,__COUNTER__)
+
+/* Whatever other unix that has sys/param.h */
+#elif defined(HAVE_SYS_PARAM_H)
+#include <sys/param.h>
+#define flac_max(a,b) MAX(a,b)
+#define flac_min(a,b) MIN(a,b)
+
+/* Windows VS has them in stdlib.h.. XXX:Untested */
+#elif defined(_MSC_VER)
+#include <stdlib.h>
+#define flac_max(a,b) __max(a,b)
+#define flac_min(a,b) __min(a,b)
#endif
-typedef struct FLAC__StreamDecoderProtected {
- FLAC__StreamDecoderState state;
- unsigned channels;
- FLAC__ChannelAssignment channel_assignment;
- unsigned bits_per_sample;
- unsigned sample_rate; /* in Hz */
- unsigned blocksize; /* in samples (per channel) */
- FLAC__bool md5_checking; /* if true, generate MD5 signature of decoded data and compare against signature in the STREAMINFO metadata block */
-#if FLAC__HAS_OGG
- FLAC__OggDecoderAspect ogg_decoder_aspect;
+#ifndef MIN
+#define MIN(x,y) ((x) <= (y) ? (x) : (y))
#endif
-} FLAC__StreamDecoderProtected;
-/*
- * return the number of input bytes consumed
- */
-unsigned FLAC__stream_decoder_get_input_bytes_unconsumed(const FLAC__StreamDecoder *decoder);
+#ifndef MAX
+#define MAX(x,y) ((x) >= (y) ? (x) : (y))
+#endif
#endif
« no previous file with comments | « src/libFLAC/include/private/lpc.h ('k') | src/libFLAC/include/private/md5.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698