wrapped vorbisfile.h static callbacks in #ifndef
authorMonty <xiphmont@xiph.org>
Mon, 27 Apr 2009 22:12:58 +0000 (22:12 +0000)
committerMonty <xiphmont@xiph.org>
Mon, 27 Apr 2009 22:12:58 +0000 (22:12 +0000)
OV_EXCLUDE_STATIC_CALLBACKS

svn path=/trunk/vorbis/; revision=15962

include/vorbis/vorbisfile.h

index e128fe8..0f1b00b 100644 (file)
@@ -63,12 +63,15 @@ static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){
 /* These structs below (OV_CALLBACKS_DEFAULT etc) are defined here as
  * static data. That means that every file which includes this header
  * will get its own copy of these structs whether it uses them or
- * not. This is essential on platforms such as Windows on which
- * several different versions of stdio support may be linked to by
- * different DLLs, and we need to be certain we know which one we're
- * using (the same one as the main application).
+ * not unless it #defines OV_EXCLUDE_STATIC_CALLBACKS.
+ * These static symbols are essential on platforms such as Windows on
+ * which several different versions of stdio support may be linked to
+ * by different DLLs, and we need to be certain we know which one
+ * we're using (the same one as the main application).
  */
 
+#ifndef OV_EXCLUDE_STATIC_CALLBACKS
+
 static ov_callbacks OV_CALLBACKS_DEFAULT = {
   (size_t (*)(void *, size_t, size_t, void *))  fread,
   (int (*)(void *, ogg_int64_t, int))           _ov_header_fseek_wrap,
@@ -97,6 +100,8 @@ static ov_callbacks OV_CALLBACKS_STREAMONLY_NOCLOSE = {
   (long (*)(void *))                            NULL
 };
 
+#endif
+
 #define  NOTOPEN   0
 #define  PARTOPEN  1
 #define  OPENED    2