Working out an error with unistd.h in windows.

This commit is contained in:
Ward Fisher 2017-01-30 14:54:00 -07:00
parent 594f50a067
commit 870b6c534f
5 changed files with 541 additions and 356 deletions

View File

@ -1169,6 +1169,8 @@ CHECK_SYMBOL_EXISTS(isinf "math.h" HAVE_DECL_ISINF)
CHECK_SYMBOL_EXISTS(signbit "math.h" HAVE_DECL_SIGNBIT)
CHECK_SYMBOL_EXISTS(st_blksize "sys/stat.h" HAVE_STRUCT_STAT_ST_BLKSIZE)
CHECK_SYMBOL_EXISTS(alloca "alloca.h" HAVE_ALLOCA)
CHECK_SYMBOL_EXISTS(snprintf "stdio.h" HAVE_SNPRINTF)
CHECK_SYMBOL_EXISTS(vprintf "stdio.h" HAVE_VPRINTF)
# For historic purposes...
SET(HAVE_ST_BLKSIZE ${HAVE_STRUCT_STAT_ST_BLKSIZE})
@ -1245,7 +1247,6 @@ ENDIF()
CHECK_FUNCTION_EXISTS(fsync HAVE_FSYNC)
CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT)
CHECK_FUNCTION_EXISTS(strerror HAVE_STRERROR)
CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
CHECK_FUNCTION_EXISTS(strchr HAVE_STRCHR)
CHECK_FUNCTION_EXISTS(strrchr HAVE_STRRCHR)
CHECK_FUNCTION_EXISTS(strcat HAVE_STRCAT)
@ -1283,7 +1284,6 @@ IF(ENABLE_MMAP)
ENDIF(NOT HAVE_MREMAP)
ENDIF(ENABLE_MMAP)
CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF)
#CHECK_FUNCTION_EXISTS(alloca HAVE_ALLOCA)
#####
# End system inspection checks.

View File

@ -555,8 +555,13 @@
/* Define strcasecmp, snprintf on Win32 systems. */
#ifdef _WIN32
#ifndef HAVE_STRCASECMP
#define strcasecmp _stricmp
#endif
#ifndef HAVE_SNPRINTF
#define snprintf _snprintf
#endif
#endif
#include "ncconfigure.h"

View File

@ -1,5 +1,5 @@
#line 3 "ncgenl.c"
#line 3 "lex.ncg.c"
#define YY_INT_ALIGNED short int
@ -65,7 +65,6 @@ typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
@ -73,7 +72,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@ -104,6 +102,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@ -160,7 +160,15 @@ typedef unsigned int flex_uint32_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@ -172,12 +180,7 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
extern yy_size_t ncgleng;
extern int ncgleng;
extern FILE *ncgin, *ncgout;
@ -203,6 +206,11 @@ extern FILE *ncgin, *ncgout;
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@ -220,7 +228,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
yy_size_t yy_n_chars;
int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@ -290,8 +298,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* yy_hold_char holds the character lost when ncgtext is formed. */
static char yy_hold_char;
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t ncgleng;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
int ncgleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
@ -319,7 +327,7 @@ static void ncg_init_buffer (YY_BUFFER_STATE b,FILE *file );
YY_BUFFER_STATE ncg_scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE ncg_scan_string (yyconst char *yy_str );
YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,yy_size_t len );
YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,int len );
void *ncgalloc (yy_size_t );
void *ncgrealloc (void *,yy_size_t );
@ -374,7 +382,7 @@ static void yy_fatal_error (yyconst char msg[] );
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
ncgleng = (yy_size_t) (yy_cp - yy_bp); \
ncgleng = (size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
@ -1320,7 +1328,7 @@ ID ([A-Za-z_]|{UTF8})([A-Z.@#\[\]a-z_0-9+-]|{UTF8})*
/* Note: this definition of string will work for utf8 as well,
although it is a very relaxed definition
*/
#line 1324 "ncgenl.c"
#line 1332 "lex.ncg.c"
#define INITIAL 0
#define ST_C_COMMENT 1
@ -1361,7 +1369,7 @@ FILE *ncgget_out (void );
void ncgset_out (FILE * out_str );
yy_size_t ncgget_leng (void );
int ncgget_leng (void );
char *ncgget_text (void );
@ -1403,7 +1411,12 @@ static int input (void );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@ -1411,7 +1424,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO fwrite( ncgtext, ncgleng, 1, ncgout )
#define ECHO do { if (fwrite( ncgtext, ncgleng, 1, ncgout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@ -1422,7 +1435,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
yy_size_t n; \
size_t n; \
for ( n = 0; n < max_size && \
(c = getc( ncgin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@ -1506,7 +1519,7 @@ YY_DECL
#line 217 "ncgen.l"
#line 1510 "ncgenl.c"
#line 1523 "lex.ncg.c"
if ( !(yy_init) )
{
@ -2119,7 +2132,7 @@ YY_RULE_SETUP
#line 570 "ncgen.l"
ECHO;
YY_BREAK
#line 2123 "ncgenl.c"
#line 2136 "lex.ncg.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(TEXT):
yyterminate();
@ -2306,7 +2319,7 @@ static int yy_get_next_buffer (void)
else
{
yy_size_t num_to_read =
int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
@ -2320,7 +2333,7 @@ static int yy_get_next_buffer (void)
if ( b->yy_is_our_buffer )
{
yy_size_t new_size = b->yy_buf_size * 2;
int new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
@ -2351,7 +2364,7 @@ static int yy_get_next_buffer (void)
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
(yy_n_chars), num_to_read );
(yy_n_chars), (size_t) num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
@ -2461,7 +2474,7 @@ static int yy_get_next_buffer (void)
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
register yy_size_t number_to_move = (yy_n_chars) + 2;
register int number_to_move = (yy_n_chars) + 2;
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char *source =
@ -2510,7 +2523,7 @@ static int yy_get_next_buffer (void)
else
{ /* need more input */
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
int offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
@ -2534,7 +2547,7 @@ static int yy_get_next_buffer (void)
case EOB_ACT_END_OF_FILE:
{
if ( ncgwrap( ) )
return 0;
return EOF;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
@ -2786,7 +2799,7 @@ void ncgpop_buffer_state (void)
*/
static void ncgensure_buffer_stack (void)
{
yy_size_t num_to_alloc;
int num_to_alloc;
if (!(yy_buffer_stack)) {
@ -2878,16 +2891,17 @@ YY_BUFFER_STATE ncg_scan_string (yyconst char * yystr )
/** Setup the input buffer state to scan the given bytes. The next call to ncglex() will
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, int _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n, i;
yy_size_t n;
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
@ -2969,7 +2983,7 @@ FILE *ncgget_out (void)
/** Get the length of the current token.
*
*/
yy_size_t ncgget_leng (void)
int ncgget_leng (void)
{
return ncgleng;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,14 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.2. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -16,9 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@ -33,6 +31,7 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@ -92,80 +91,33 @@
DATASETID = 308
};
#endif
/* Tokens. */
#define NC_UNLIMITED_K 258
#define CHAR_K 259
#define BYTE_K 260
#define SHORT_K 261
#define INT_K 262
#define FLOAT_K 263
#define DOUBLE_K 264
#define UBYTE_K 265
#define USHORT_K 266
#define UINT_K 267
#define INT64_K 268
#define UINT64_K 269
#define IDENT 270
#define TERMSTRING 271
#define CHAR_CONST 272
#define BYTE_CONST 273
#define SHORT_CONST 274
#define INT_CONST 275
#define INT64_CONST 276
#define UBYTE_CONST 277
#define USHORT_CONST 278
#define UINT_CONST 279
#define UINT64_CONST 280
#define FLOAT_CONST 281
#define DOUBLE_CONST 282
#define DIMENSIONS 283
#define VARIABLES 284
#define NETCDF 285
#define DATA 286
#define TYPES 287
#define COMPOUND 288
#define ENUM 289
#define OPAQUE 290
#define OPAQUESTRING 291
#define GROUP 292
#define PATH 293
#define FILLMARKER 294
#define NIL 295
#define _FILLVALUE 296
#define _FORMAT 297
#define _STORAGE 298
#define _CHUNKSIZES 299
#define _DEFLATELEVEL 300
#define _SHUFFLE 301
#define _ENDIANNESS 302
#define _NOFILL 303
#define _FLETCHER32 304
#define _NCPROPS 305
#define _ISNETCDF4 306
#define _SUPERBLOCK 307
#define DATASETID 308
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
#line 136 "ncgen.y"
{
/* Line 1685 of yacc.c */
#line 136 "ncgen.y"
Symbol* sym;
unsigned long size; /* allow for zero size to indicate e.g. UNLIMITED*/
long mark; /* track indices into the sequence*/
int nctype; /* for tracking attribute list type*/
Datalist* datalist;
NCConstant constant;
}
/* Line 1529 of yacc.c. */
#line 164 "ncgeny.h"
YYSTYPE;
/* Line 1685 of yacc.c */
#line 115 "ncgen.tab.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE ncglval;