This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
>Date: Mon, 16 Jun 1997 12:30:10 -0400 (EDT) >From: address@hidden >Organization: KEO Consultants >To: address@hidden >Subject: DOS implementation of netCDF, cont. >Keywords: 199705081559.JAA25699 > Making a lot of progress on the DOS/Win16 port of the NetCDF 3.3 library. > > I'm currently down to one error! > > In line 1531 of ncx.c, the #error line: > > "x_size_t implementation" > > In DOS/Win16, size_t is defined as unsigned int which is 2 bytes. > > In your ncx.h file, X_SIZEOF_SIZE_T is set to 4 bytes, and the comment > suggests that this is necessary for the implementation of the netcdf > library. > > Does this mean that I can't implement the library in DOS/Win16 at all? X_SIZEOF_SIZE_T is the size of an "external" size_t and is invariant. You should not change any of these X_ values, or anything else in ncx.h, in the process of porting. The #error means that versions of ncx_get_size_t() and ncx_put_size_t() needs to be implemented which handle the case of a 16 bit size_t. This is actually pretty straightforward. For ncx_get_size_t() Get a 32 bit long Check if it > SIZEOF_SIZE_T, if so set error return to NC_ERANGE. assign the long to the size_t return parameter *lp. Inverse process for ncx_put_size_t(), except you know you can never exceed the external range. You may run into a similar situation for the off_t functions. In practice, this means that netcdf array lengths are limited by the size_t on the system. -glenn