Message-ID: From: "Hamilton, Eric" To: djgpp AT delorie DOT com Subject: Minor problems with header files Date: Thu, 4 Nov 1999 11:53:10 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01BF26FE.38BFE6F4" Reply-To: djgpp AT delorie DOT com This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01BF26FE.38BFE6F4 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01BF26FE.38BFE6F4" ------_=_NextPart_001_01BF26FE.38BFE6F4 Content-Type: text/plain Hi I always run gcc with every possiable warning message turned on. I have been getting several (2) messages about "redefining" things. I have modified three of the standard header files to eliminate this problem and have included them here. It would be nice if these changes could make it into a future software release. <> <<...>> <> bye...............eric Note: If you are not the intended recipient of this e-mail, contact administrator AT pelco DOT com or call (559) 292-1981. Information contained may be confidential. Dissemination, distribution or copying of this e-mail is prohibited if you are not the intended recipient. ------_=_NextPart_001_01BF26FE.38BFE6F4 Content-Type: text/html Content-Transfer-Encoding: quoted-printable Minor problems with header files

Hi

I always run gcc with every possiable = warning message turned on.  I have been getting several (2) = messages about "redefining" things.  I have modified = three of the standard header files to eliminate this problem and have = included them here.  It would be nice if these changes could make = it into a future software release.

= <<unistd.h>>
= <<...>> <<pc.h>>

bye...............eric
Note: If you are not the intended = recipient of this e-mail, contact administrator AT pelco DOT com or call (559) = 292-1981.  Information contained may be confidential.  = Dissemination, distribution or copying of this e-mail is prohibited if = you are not the intended recipient.

------_=_NextPart_001_01BF26FE.38BFE6F4-- ------_=_NextPart_000_01BF26FE.38BFE6F4 Content-Type: application/octet-stream; name="unistd.h" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="unistd.h" /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #ifndef __dj_include_unistd_h_ #define __dj_include_unistd_h_ #ifdef __cplusplus extern "C" { #endif #ifndef __dj_ENFORCE_ANSI_FREESTANDING #ifndef __STRICT_ANSI__ #include /* NOT POSIX but you can't include just unistd.h = without it */ #include #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 =20 /* Some programs think they know better... */ #undef NULL #define NULL 0 #define F_OK 0x01 #define R_OK 0x02 #define W_OK 0x04 #define X_OK 0x08 #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 #define _PC_CHOWN_RESTRICTED 1 #define _PC_LINK_MAX 2 #define _PC_MAX_CANON 3 #define _PC_MAX_INPUT 4 #define _PC_NAME_MAX 5 #define _PC_NO_TRUNC 6 #define _PC_PATH_MAX 7 #define _PC_PIPE_BUF 8 #define _PC_VDISABLE 9 #define _POSIX_CHOWN_RESTRICTED 0 #undef _POSIX_JOB_CONTROL #define _POSIX_NO_TRUNC 0 #undef _POSIX_SAVED_IDS #define _POSIX_VDISABLE -1 #define _POSIX_VERSION 199009L #define _SC_ARG_MAX 1 #define _SC_CHILD_MAX 2 #define _SC_CLK_TCK 3 #define _SC_JOB_CONTROL 4 #define _SC_NGROUPS_MAX 5 #define _SC_OPEN_MAX 6 #define _SC_SAVED_IDS 7 #define _SC_STREAM_MAX 8 #define _SC_TZNAME_MAX 9 #define _SC_VERSION 10 =20 __DJ_size_t #undef __DJ_size_t #define __DJ_size_t __DJ_ssize_t #undef __DJ_ssize_t #define __DJ_ssize_t extern char *optarg; extern int optind, opterr, optopt; void __exit(int _status) __attribute__((noreturn)); void _exit(int _status) __attribute__((noreturn)); int access(const char *_path, int _amode); unsigned int alarm(unsigned int _seconds); int chdir(const char *_path); int chown(const char *_path, uid_t _owner, gid_t _group); int close(int _fildes); char * ctermid(char *_s); int dup(int _fildes); int dup2(int _fildes, int _fildes2); int execl(const char *_path, const char *_arg, ...); int execle(const char *_path, const char *_arg, ...); int execlp(const char *_file, const char *_arg, ...); int execv(const char *_path, char *const _argv[]); int execve(const char *_path, char *const _argv[], char = *const _envp[]); int execvp(const char *_file, char *const _argv[]); pid_t fork(void); long fpathconf(int _fildes, int _name); char * getcwd(char *_buf, size_t _size); gid_t getegid(void); uid_t geteuid(void); gid_t getgid(void); int getgroups(int _gidsetsize, gid_t *_grouplist); char * getlogin(void); int getopt(int _argc, char *const _argv[], const char = *_optstring); pid_t getpgrp(void); pid_t getpid(void); pid_t getppid(void); uid_t getuid(void); int isatty(int _fildes); int link(const char *_existing, const char *_new); off_t lseek(int _fildes, off_t _offset, int _whence); long pathconf(const char *_path, int _name); int pause(void); int pipe(int _fildes[2]); ssize_t read(int _fildes, void *_buf, size_t _nbyte); int rmdir(const char *_path); int setgid(gid_t _gid); int setpgid(pid_t _pid, pid_t _pgid); pid_t setsid(void); int setuid(uid_t uid); unsigned int sleep(unsigned int _seconds); long sysconf(int _name); pid_t tcgetpgrp(int _fildes); int tcsetpgrp(int _fildes, pid_t _pgrp_id); char * ttyname(int _fildes); int unlink(const char *_path); ssize_t write(int _fildes, const void *_buf, size_t _nbyte); #ifndef _POSIX_SOURCE /* additional access() checks */ #define D_OK 0x10 char * basename(const char *_fn); int brk(void *_heaptop); char * dirname(const char *_fn); int __file_exists(const char *_fn); int fsync(int _fd); int ftruncate(int, off_t); int getdtablesize(void); int gethostname(char *buf, int size); int getpagesize(void); char * getwd(char *__buffer); int nice(int _increment); void * sbrk(int _delta); int symlink (const char *, const char *); int sync(void); int truncate(const char*, off_t); unsigned int usleep(unsigned int _useconds); #ifndef __dj_include_sys_config_h_ // 04NOV99 pid_t vfork(void); #endif // __dj_include_sys_config_h_ // 04NOV99 #endif /* !_POSIX_SOURCE */ #endif /* !__STRICT_ANSI__ */ #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ #ifndef __dj_ENFORCE_FUNCTION_CALLS #endif /* !__dj_ENFORCE_FUNCTION_CALLS */ #ifdef __cplusplus } #endif #endif /* !__dj_include_unistd_h_ */ ------_=_NextPart_000_01BF26FE.38BFE6F4 Content-Type: application/octet-stream; name="pc.h" Content-Disposition: attachment; filename="pc.h" /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #ifndef __dj_include_pc_h_ #define __dj_include_pc_h_ #ifdef __cplusplus extern "C" { #endif #ifndef __dj_ENFORCE_ANSI_FREESTANDING #ifndef __STRICT_ANSI__ #ifndef _POSIX_SOURCE unsigned char inportb (unsigned short _port); unsigned short inportw (unsigned short _port); unsigned long inportl (unsigned short _port); void inportsb (unsigned short _port, unsigned char *_buf, unsigned _len); void inportsw (unsigned short _port, unsigned short *_buf, unsigned _len); void inportsl (unsigned short _port, unsigned long *_buf, unsigned _len); void outportb (unsigned short _port, unsigned char _data); void outportw (unsigned short _port, unsigned short _data); void outportl (unsigned short _port, unsigned long _data); void outportsb(unsigned short _port, const unsigned char *_buf, unsigned _len); void outportsw(unsigned short _port, const unsigned short *_buf, unsigned _len); void outportsl(unsigned short _port, const unsigned long *_buf, unsigned _len); unsigned char inp(unsigned short _port); unsigned short inpw(unsigned short _port); void outp(unsigned short _port, unsigned char _data); void outpw(unsigned short _port, unsigned short _data); #ifndef __dj_include_conio_h_ // 04NOV99 int kbhit(void); #endif // __dj_include_conio_h_ // 04NOV99 int getkey(void); /* ALT's have 0x100 set */ int getxkey(void); /* ALT's have 0x100 set, 0xe0 sets 0x200 */ void sound(int _frequency); #define nosound() sound(0) extern unsigned char ScreenAttrib; #define ScreenPrimary _go32_info_block.linear_address_of_primary_screen #define ScreenSecondary _go32_info_block.linear_address_of_secondary_screen int ScreenMode(void); int ScreenRows(void); int ScreenCols(void); void ScreenPutChar(int _ch, int _attr, int _x, int _y); void ScreenGetChar(int *_ch, int *_attr, int _x, int _y); void ScreenPutString(const char *_ch, int _attr, int _x, int _y); void ScreenSetCursor(int _row, int _col); void ScreenGetCursor(int *_row, int *_col); void ScreenClear(void); void ScreenUpdate(const void *_virtual_screen); void ScreenUpdateLine(const void *_virtual_screen_line, int _row); void ScreenRetrieve(void *_virtual_screen); void ScreenVisualBell(void); #endif /* !_POSIX_SOURCE */ #endif /* !__STRICT_ANSI__ */ #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ #ifndef __dj_ENFORCE_FUNCTION_CALLS #include #endif /* !__dj_ENFORCE_FUNCTION_CALLS */ #ifdef __cplusplus } #endif #endif /* !__dj_include_pc_h_ */ ------_=_NextPart_000_01BF26FE.38BFE6F4--