From: cwolf Date: Fri, 7 Sep 2001 08:42:30 +0000 (+0000) Subject: Fix access violation for win32 vorbisenc X-Git-Tag: v1.3.3~929 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0948bd22d8a3eadf723fd93b927bbc048a16f840;p=platform%2Fupstream%2Flibvorbis.git Fix access violation for win32 vorbisenc svn path=/trunk/vorbis/; revision=1982 --- diff --git a/lib/registry.c b/lib/registry.c index b8a5d51..a96e2b8 100644 --- a/lib/registry.c +++ b/lib/registry.c @@ -11,7 +11,7 @@ ******************************************************************** function: registry for time, floor, res backends and channel mappings - last mod: $Id: registry.c,v 1.9 2001/08/13 01:36:57 xiphmont Exp $ + last mod: $Id: registry.c,v 1.10 2001/09/07 08:42:30 cwolf Exp $ ********************************************************************/ @@ -20,6 +20,7 @@ #include "registry.h" #include "misc.h" + /* seems like major overkill now; the backend numbers will grow into the infrastructure soon enough */ @@ -50,3 +51,11 @@ vorbis_func_mapping *_mapping_P[]={ &mapping0_exportbundle, }; + /* + * For win32 only, the following code needs to be appended to this file + * because the "sizeof" operator can only evaluate the sizes + * of statically initialized arrays in the same compilation unit. + */ +#if defined(_MSC_VER) && defined(STANDALONE_VORBISENC_DLL) +# include "shmmap_c.h" +#endif diff --git a/lib/vorbisenc.c b/lib/vorbisenc.c index da36ac4..8d16bdc 100644 --- a/lib/vorbisenc.c +++ b/lib/vorbisenc.c @@ -11,7 +11,7 @@ ******************************************************************** function: simple programmatic interface for encoder mode setup - last mod: $Id: vorbisenc.c,v 1.14 2001/09/01 06:14:50 xiphmont Exp $ + last mod: $Id: vorbisenc.c,v 1.15 2001/09/07 08:42:30 cwolf Exp $ ********************************************************************/ @@ -29,6 +29,19 @@ #include "os.h" #include "misc.h" +/* + * If this module gets built into a separate shared library + * on win32 (DLL), then the backend mappings from registry.c + * need to be referenced from a file-mapped shared memory segment. + */ +#if defined(_MSC_VER) && defined(STANDALONE_VORBISENC_DLL) +# include "shmmap.h" + +# define _time_P g_shared_map->p_time_P +# define _floor_P g_shared_map->p_floor_P +# define _residue_P g_shared_map->p_residue_P +# define _mapping_P g_shared_map->p_mapping_P +#endif /* deepcopy all but the codebooks; in this usage, they're static (don't copy as they could be big) */