Cleans up some leaking opus_custom symbols in celt/
diff --git a/celt/celt.c b/celt/celt.c
index 87d648f..6a33298 100644
--- a/celt/celt.c
+++ b/celt/celt.c
@@ -54,6 +54,12 @@
 #define OPUS_VERSION "unknown"
 #endif
 
+#ifdef CUSTOM_MODES
+#define OPUS_CUSTOM_NOSTATIC
+#else
+#define OPUS_CUSTOM_NOSTATIC static inline
+#endif
+
 static const unsigned char trim_icdf[11] = {126, 124, 119, 109, 87, 41, 19, 9, 4, 2, 0};
 /* Probs: NONE: 21.875%, LIGHT: 6.25%, NORMAL: 65.625%, AGGRESSIVE: 6.25% */
 static const unsigned char spread_icdf[4] = {25, 23, 2, 0};
@@ -192,7 +198,7 @@
    return opus_custom_encoder_get_size(mode, channels);
 }
 
-int opus_custom_encoder_get_size(const CELTMode *mode, int channels)
+OPUS_CUSTOM_NOSTATIC int opus_custom_encoder_get_size(const CELTMode *mode, int channels)
 {
    int size = sizeof(struct CELTEncoder)
          + (2*channels*mode->overlap-1)*sizeof(celt_sig)
@@ -232,7 +238,7 @@
       return OPUS_OK;
 }
 
-int opus_custom_encoder_init(CELTEncoder *st, const CELTMode *mode, int channels)
+OPUS_CUSTOM_NOSTATIC int opus_custom_encoder_init(CELTEncoder *st, const CELTMode *mode, int channels)
 {
    if (channels < 0 || channels > 2)
       return OPUS_BAD_ARG;
@@ -1906,7 +1912,7 @@
    return opus_custom_decoder_get_size(mode, channels);
 }
 
-int opus_custom_decoder_get_size(const CELTMode *mode, int channels)
+OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_get_size(const CELTMode *mode, int channels)
 {
    int size = sizeof(struct CELTDecoder)
             + (channels*(DECODE_BUFFER_SIZE+mode->overlap)-1)*sizeof(celt_sig)
@@ -1945,7 +1951,7 @@
       return OPUS_OK;
 }
 
-int opus_custom_decoder_init(CELTDecoder *st, const CELTMode *mode, int channels)
+OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_init(CELTDecoder *st, const CELTMode *mode, int channels)
 {
    if (channels < 0 || channels > 2)
       return OPUS_BAD_ARG;
@@ -2661,7 +2667,6 @@
 #endif
 #endif /* CUSTOM_MODES */
 
-
 int opus_custom_decoder_ctl(CELTDecoder * restrict st, int request, ...)
 {
    va_list ap;
diff --git a/celt/modes.c b/celt/modes.c
index 0c3e374..64b0226 100644
--- a/celt/modes.c
+++ b/celt/modes.c
@@ -397,11 +397,11 @@
 #endif /* !CUSTOM_MODES */
 }
 
+#ifdef CUSTOM_MODES
 void opus_custom_mode_destroy(CELTMode *mode)
 {
    if (mode == NULL)
       return;
-#ifdef CUSTOM_MODES
 #ifndef CUSTOM_MODES_ONLY
    {
      int i;
@@ -426,5 +426,5 @@
    clt_mdct_clear(&mode->mdct);
 
    opus_free((CELTMode *)mode);
-#endif
 }
+#endif
diff --git a/celt/opus_custom.h b/celt/opus_custom.h
index 1391de7..a497d79 100644
--- a/celt/opus_custom.h
+++ b/celt/opus_custom.h
@@ -44,8 +44,14 @@
 
 #ifdef CUSTOM_MODES
 #define OPUS_CUSTOM_EXPORT OPUS_EXPORT
+#define OPUS_CUSTOM_EXPORT_STATIC OPUS_EXPORT
 #else
 #define OPUS_CUSTOM_EXPORT
+#ifdef CELT_C
+#define OPUS_CUSTOM_EXPORT_STATIC static inline
+#else
+#define OPUS_CUSTOM_EXPORT_STATIC
+#endif
 #endif
 
 /** Contains the state of an encoder. One encoder state is needed
@@ -66,7 +72,6 @@
     bad */
 typedef struct OpusCustomMode OpusCustomMode;
 
-
 /** Creates a new mode struct. This will be passed to an encoder or
     decoder. The mode MUST NOT BE DESTROYED until the encoders and
     decoders that use it are destroyed as well.
@@ -84,11 +89,9 @@
 */
 OPUS_CUSTOM_EXPORT void opus_custom_mode_destroy(OpusCustomMode *mode);
 
-
-
 /* Encoder */
 
-OPUS_CUSTOM_EXPORT int opus_custom_encoder_get_size(const OpusCustomMode *mode, int channels);
+OPUS_CUSTOM_EXPORT_STATIC int opus_custom_encoder_get_size(const OpusCustomMode *mode, int channels);
 
 /** Creates a new encoder state. Each stream needs its own encoder
     state (can't be shared across simultaneous streams).
@@ -101,7 +104,7 @@
 */
 OPUS_CUSTOM_EXPORT OpusCustomEncoder *opus_custom_encoder_create(const OpusCustomMode *mode, int channels, int *error);
 
-OPUS_CUSTOM_EXPORT int opus_custom_encoder_init(OpusCustomEncoder *st, const OpusCustomMode *mode, int channels);
+OPUS_CUSTOM_EXPORT_STATIC int opus_custom_encoder_init(OpusCustomEncoder *st, const OpusCustomMode *mode, int channels);
 
 /** Destroys a an encoder state.
  @param st Encoder state to be destroyed
@@ -152,11 +155,9 @@
 */
 OPUS_CUSTOM_EXPORT int opus_custom_encoder_ctl(OpusCustomEncoder * restrict st, int request, ...);
 
-
-
 /* Decoder */
 
-OPUS_CUSTOM_EXPORT int opus_custom_decoder_get_size(const OpusCustomMode *mode, int channels);
+OPUS_CUSTOM_EXPORT_STATIC int opus_custom_decoder_get_size(const OpusCustomMode *mode, int channels);
 
 /** Creates a new decoder state. Each stream needs its own decoder state (can't
     be shared across simultaneous streams).
@@ -168,7 +169,7 @@
  */
 OPUS_CUSTOM_EXPORT OpusCustomDecoder *opus_custom_decoder_create(const OpusCustomMode *mode, int channels, int *error);
 
-OPUS_CUSTOM_EXPORT int opus_custom_decoder_init(OpusCustomDecoder *st, const OpusCustomMode *mode, int channels);
+OPUS_CUSTOM_EXPORT_STATIC int opus_custom_decoder_init(OpusCustomDecoder *st, const OpusCustomMode *mode, int channels);
 
 /** Destroys a a decoder state.
  @param st Decoder state to be destroyed
@@ -205,7 +206,6 @@
  */
 OPUS_CUSTOM_EXPORT int opus_custom_decoder_ctl(OpusCustomDecoder * restrict st, int request, ...);
 
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/celt/tests/cwrs32-test.c b/celt/tests/cwrs32-test.c
index ee73315..ba19e4b 100644
--- a/celt/tests/cwrs32-test.c
+++ b/celt/tests/cwrs32-test.c
@@ -5,6 +5,12 @@
 #include <stdio.h>
 #include <string.h>
 
+#ifndef CUSTOM_MODES
+#define CUSTOM_MODES
+#else
+#define TEST_CUSTOM_MODES
+#endif
+
 #define CELT_C
 #include "../celt/stack_alloc.h"
 #include "../celt/entenc.c"
@@ -17,7 +23,7 @@
 #define NMAX (240)
 #define KMAX (128)
 
-#ifdef CUSTOM_MODES
+#ifdef TEST_CUSTOM_MODES
 
 #define NDIMS (46)
 static const int pn[NDIMS]={
@@ -37,7 +43,7 @@
    4
 };
 
-#else /* CUSTOM_MODES */
+#else /* TEST_CUSTOM_MODES */
 
 #define NDIMS (22)
 static const int pn[NDIMS]={
diff --git a/celt/tests/mathops-test.c b/celt/tests/mathops-test.c
index b4eb3c0..92a7970 100644
--- a/celt/tests/mathops-test.c
+++ b/celt/tests/mathops-test.c
@@ -2,6 +2,10 @@
 #include "config.h"
 #endif
 
+#ifndef CUSTOM_MODES
+#define CUSTOM_MODES
+#endif
+
 #define CELT_C
 
 #include "mathops.c"
diff --git a/celt/tests/rotation-test.c b/celt/tests/rotation-test.c
index 0540568..29082b6 100644
--- a/celt/tests/rotation-test.c
+++ b/celt/tests/rotation-test.c
@@ -2,6 +2,10 @@
 #include "config.h"
 #endif
 
+#ifndef CUSTOM_MODES
+#define CUSTOM_MODES
+#endif
+
 #define CELT_C
 
 #include <stdio.h>