/** * This file has no copyright assigned and is placed in the Public Domain. * This file is part of the w64 mingw-runtime package. * No warranty is given; refer to the file DISCLAIMER within this package. */ #ifndef _INC_STDIO #define _INC_STDIO #include <_mingw.h> #pragma pack(push,_CRT_PACKING) #ifdef __cplusplus extern "C" { #endif #define BUFSIZ 512 #define _NFILE _NSTREAM_ #define _NSTREAM_ 512 #define _IOB_ENTRIES 20 #define EOF (-1) #ifndef _FILE_DEFINED struct _iobuf { char *_ptr; int _cnt; char *_base; int _flag; int _file; int _charbuf; int _bufsiz; char *_tmpfname; }; typedef struct _iobuf FILE; #define _FILE_DEFINED #endif #ifdef _POSIX_ #define _P_tmpdir "/" #define _wP_tmpdir L"/" #else #define _P_tmpdir "\\" #define _wP_tmpdir L"\\" #endif #define L_tmpnam (sizeof(_P_tmpdir) + 12) #ifdef _POSIX_ #define L_ctermid 9 #define L_cuserid 32 #endif #define SEEK_CUR 1 #define SEEK_END 2 #define SEEK_SET 0 #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 #define FILENAME_MAX 260 #define FOPEN_MAX 20 #define _SYS_OPEN 20 #define TMP_MAX 32767 #ifndef NULL #ifdef __cplusplus #define NULL 0 #else #define NULL ((void *)0) #endif #endif #ifndef _OFF_T_DEFINED #define _OFF_T_DEFINED #ifndef _OFF_T_ #define _OFF_T_ typedef long _off_t; #if !defined(NO_OLDNAMES) || defined(_POSIX) typedef long off_t; #endif #endif #endif #ifndef _OFF64_T_DEFINED #define _OFF64_T_DEFINED typedef long long _off64_t; #if !defined(NO_OLDNAMES) || defined(_POSIX) typedef long long off64_t; #endif #endif #ifndef _STDIO_DEFINED #ifdef _WIN64 _CRTIMP FILE *__cdecl __iob_func(void); #else #ifdef _MSVCRT_ extern FILE _iob[]; /* A pointer to an array of FILE */ #define __iob_func() (_iob) #else extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ #define __iob_func() (*_imp___iob) #define _iob __iob_func() #endif #endif #endif #ifndef _FPOS_T_DEFINED #define _FPOS_T_DEFINED #undef _FPOSOFF #if (!defined(NO_OLDNAMES) || defined(__GNUC__)) && _INTEGRAL_MAX_BITS >= 64 typedef __int64 fpos_t; #define _FPOSOFF(fp) ((long)(fp)) #else typedef long long fpos_t; #define _FPOSOFF(fp) ((long)(fp)) #endif #endif #ifndef _STDSTREAM_DEFINED #define _STDSTREAM_DEFINED #define stdin (&__iob_func()[0]) #define stdout (&__iob_func()[1]) #define stderr (&__iob_func()[2]) #endif #define _IOREAD 0x0001 #define _IOWRT 0x0002 #define _IOFBF 0x0000 #define _IOLBF 0x0040 #define _IONBF 0x0004 #define _IOMYBUF 0x0008 #define _IOEOF 0x0010 #define _IOERR 0x0020 #define _IOSTRG 0x0040 #define _IORW 0x0080 #ifdef _POSIX_ #define _IOAPPEND 0x0200 #endif #define _TWO_DIGIT_EXPONENT 0x1 #ifndef _STDIO_DEFINED _CRTIMP int __cdecl _filbuf(FILE *_File); _CRTIMP int __cdecl _flsbuf(int _Ch,FILE *_File); #ifdef _POSIX_ _CRTIMP FILE *__cdecl _fsopen(const char *_Filename,const char *_Mode); #else _CRTIMP FILE *__cdecl _fsopen(const char *_Filename,const char *_Mode,int _ShFlag); #endif void __cdecl clearerr(FILE *_File); int __cdecl fclose(FILE *_File); _CRTIMP int __cdecl _fcloseall(void); #ifdef _POSIX_ FILE *__cdecl fdopen(int _FileHandle,const char *_Mode); #else _CRTIMP FILE *__cdecl _fdopen(int _FileHandle,const char *_Mode); #endif int __cdecl feof(FILE *_File); int __cdecl ferror(FILE *_File); int __cdecl fflush(FILE *_File); int __cdecl fgetc(FILE *_File); _CRTIMP int __cdecl _fgetchar(void); int __cdecl fgetpos(FILE *_File ,fpos_t *_Pos); char *__cdecl fgets(char *_Buf,int _MaxCount,FILE *_File); #ifdef _POSIX_ int __cdecl fileno(FILE *_File); #else _CRTIMP int __cdecl _fileno(FILE *_File); #endif _CRTIMP char *__cdecl _tempnam(const char *_DirName,const char *_FilePrefix); _CRTIMP int __cdecl _flushall(void); FILE *__cdecl fopen(const char *_Filename,const char *_Mode); FILE *fopen64(const char *filename,const char *mode); int __cdecl fprintf(FILE *_File,const char *_Format,...); int __cdecl fputc(int _Ch,FILE *_File); _CRTIMP int __cdecl _fputchar(int _Ch); int __cdecl fputs(const char *_Str,FILE *_File); size_t __cdecl fread(void *_DstBuf,size_t _ElementSize,size_t _Count,FILE *_File); FILE *_
discard """
  output: '''7
8 8
-2'''
"""

#bug 1063

const
  KeyMax = 227
  myconst = int((KeyMax + 31) / 32)

type
  FU = array[int((KeyMax + 31) / 32), cuint]

echo FU.high

type
  PKeyboard* = ptr object
  TKeyboardState* = object
    display*: pointer
    internal: array[int((KeyMax + 31)/32), cuint]

echo myconst, " ", int((KeyMax + 31) / 32)

#bug 1304 or something:

const constArray: array [-3..2, int] = [-3, -2, -1, 0, 1, 2]

echo constArray[-2]
mpdir #define SYS_OPEN _SYS_OPEN char *__cdecl tempnam(const char *_Directory,const char *_FilePrefix); int __cdecl fcloseall(void); FILE *__cdecl fdopen(int _FileHandle,const char *_Format); int __cdecl fgetchar(void); int __cdecl fileno(FILE *_File); int __cdecl flushall(void); int __cdecl fputchar(int _Ch); int __cdecl getw(FILE *_File); int __cdecl putw(int _Ch,FILE *_File); int __cdecl rmtmp(void); #endif #ifdef __cplusplus } #endif #pragma pack(pop) #include #endif