Re: [AD] MSVC problem with dat2c generated files

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]



i remember there being a compiler switch to adjust that.. coz i wrote my own
bmp8 to char[]  converter that often exceeded  64k.
i had the problem when i used msvc6
since using msvc7,1 i have not that problem.
so i think 7.1 doesn't need the compiler switch.





MSVC seems to have an undocumented feature: constant strings are limited
to 64k.
dat2c generates constant strings into the C-files.
In case of data file objects of type DATA (i.e. binary) it would be a
bit pity to assume arbitrary data to be at most 64k. I have no idea how
to solve this. A somewhat dirty solution would be to replace
const unsigned char name[4]="abcd";
with
const unsigned char name_tmp[2][2]={{97,98},{99,100}};
#define name (const unsigned char *)name_tmp
But I don't like it, any ideas?

Also in case of BMP the line array can easily grow to more than 64k. If
anyone know if the line array has to be in a single memory block, it
would be fine to know. An idea is to split the BMP string into separate
chunks, one for each line.

--
Christer Sandberg <csg01@xxxxxxxxxx>



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
--
https://lists.sourceforge.net/lists/listinfo/alleg-developers





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/