diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 8c07fd596..d8824221f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,13 @@ +2013-04-30 Yaakov Selkowitz + + Throughout, (mainly in fhandler*) fix remaining gcc 4.7 mismatch + warnings between regparm definitions and declarations. + * smallprint.cc (__small_vswprintf): Conditionalize declaration and + setting of l_opt for only x86_64. + * spawn.cc (child_info_spawn::worker): Remove unused 'pid' variable. + * thread.cc (verifyable_object_isvalid): Temporarily define as + non-inline with gcc 4.7+, regardless of target. + 2013-04-30 Christopher Faylor * gendef: Fix sigfe.s typo. diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 450667099..f7e3249a5 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -216,7 +216,7 @@ fhandler_base::set_flags (int flags, int supplied_bin) /* Cover function to ReadFile to achieve (as much as possible) Posix style semantics and use of errno. */ -void __stdcall +void __reg3 fhandler_base::raw_read (void *ptr, size_t& len) { NTSTATUS status; @@ -282,7 +282,7 @@ retry: /* Cover function to WriteFile to provide Posix interface and semantics (as much as possible). */ -ssize_t __stdcall +ssize_t __reg3 fhandler_base::raw_write (const void *ptr, size_t len) { NTSTATUS status; @@ -722,7 +722,7 @@ done: an \n. If last char is an \r, look ahead one more char, if \n then modify \r, if not, remember char. */ -void __stdcall +void __reg3 fhandler_base::read (void *in_ptr, size_t& len) { char *ptr = (char *) in_ptr; @@ -1055,14 +1055,14 @@ fhandler_base::lseek (off_t offset, int whence) return res; } -ssize_t __stdcall +ssize_t __reg3 fhandler_base::pread (void *, size_t, off_t) { set_errno (ESPIPE); return -1; } -ssize_t __stdcall +ssize_t __reg3 fhandler_base::pwrite (void *, size_t, off_t) { set_errno (ESPIPE); @@ -1278,7 +1278,7 @@ fhandler_base::fstat (struct stat *buf) return 0; } -int __stdcall +int __reg2 fhandler_base::fstatvfs (struct statvfs *sfs) { /* If we hit this base implementation, it's some device in /dev. diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 7e7b6cf58..14802790a 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -318,7 +318,7 @@ fhandler_console::mouse_aware (MOUSE_EVENT_RECORD& mouse_event) || dev_state.use_mouse >= 3)); } -void __stdcall +void __reg3 fhandler_console::read (void *pv, size_t& buflen) { push_process_state process_state (PID_TTYIN); diff --git a/winsup/cygwin/fhandler_dev.cc b/winsup/cygwin/fhandler_dev.cc index 8a9808f8e..48ac0b70f 100644 --- a/winsup/cygwin/fhandler_dev.cc +++ b/winsup/cygwin/fhandler_dev.cc @@ -81,7 +81,7 @@ fhandler_dev::fstat (struct stat *st) return 0; } -int __stdcall +int __reg2 fhandler_dev::fstatvfs (struct statvfs *sfs) { int ret = -1, opened = 0; diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 93b02fe11..80ebfce48 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -319,7 +319,7 @@ path_conv::ndisk_links (DWORD nNumberOfLinks) This returns the content of a struct fattr3 as defined in RFC 1813. The content is the NFS equivalent of struct stat. so there's not much to do here except for copying. */ -int __stdcall +int __reg2 fhandler_base::fstat_by_nfs_ea (struct stat *buf) { fattr3 *nfs_attr = pc.nfsattr (); @@ -362,7 +362,7 @@ fhandler_base::fstat_by_nfs_ea (struct stat *buf) return 0; } -int __stdcall +int __reg2 fhandler_base::fstat_by_handle (struct stat *buf) { /* Don't use FileAllInformation info class. It returns a pathname rather @@ -420,7 +420,7 @@ fhandler_base::fstat_by_handle (struct stat *buf) return fstat_helper (buf, fsi.NumberOfLinks); } -int __stdcall +int __reg2 fhandler_base::fstat_by_name (struct stat *buf) { NTSTATUS status; @@ -464,7 +464,7 @@ fhandler_base::fstat_by_name (struct stat *buf) return fstat_helper (buf, 1); } -int __stdcall +int __reg2 fhandler_base::fstat_fs (struct stat *buf) { int res = -1; @@ -508,7 +508,7 @@ fhandler_base::fstat_fs (struct stat *buf) return res; } -int __stdcall +int __reg3 fhandler_base::fstat_helper (struct stat *buf, DWORD nNumberOfLinks) { @@ -708,7 +708,7 @@ fhandler_disk_file::fstat (struct stat *buf) return fstat_fs (buf); } -int __stdcall +int __reg2 fhandler_disk_file::fstatvfs (struct statvfs *sfs) { int ret = -1, opened = 0; @@ -783,7 +783,7 @@ out: return ret; } -int __stdcall +int __reg1 fhandler_disk_file::fchmod (mode_t mode) { extern int chmod_device (path_conv& pc, mode_t mode); @@ -891,7 +891,7 @@ out: return res; } -int __stdcall +int __reg2 fhandler_disk_file::fchown (uid_t uid, gid_t gid) { int oret = 0; @@ -959,7 +959,7 @@ fhandler_disk_file::fchown (uid_t uid, gid_t gid) return res; } -int _stdcall +int __reg3 fhandler_disk_file::facl (int cmd, int nentries, aclent_t *aclbufp) { int res = -1; @@ -1535,7 +1535,7 @@ fhandler_disk_file::prw_open (bool write) return 0; } -ssize_t __stdcall +ssize_t __reg3 fhandler_disk_file::pread (void *buf, size_t count, off_t offset) { ssize_t res; @@ -1609,7 +1609,7 @@ non_atomic: return res; } -ssize_t __stdcall +ssize_t __reg3 fhandler_disk_file::pwrite (void *buf, size_t count, off_t offset) { if ((get_flags () & O_ACCMODE) == O_RDONLY) @@ -1924,7 +1924,7 @@ free_dir: return res; } -ino_t __stdcall +ino_t __reg2 readdir_get_ino (const char *path, bool dot_dot) { char *fname; @@ -2393,7 +2393,7 @@ fhandler_cygdrive::fstat (struct stat *buf) return 0; } -int __stdcall +int __reg2 fhandler_cygdrive::fstatvfs (struct statvfs *sfs) { /* Virtual file system. Just return an empty buffer with a few values diff --git a/winsup/cygwin/fhandler_dsp.cc b/winsup/cygwin/fhandler_dsp.cc index c80705836..72256b056 100644 --- a/winsup/cygwin/fhandler_dsp.cc +++ b/winsup/cygwin/fhandler_dsp.cc @@ -1095,7 +1095,7 @@ fhandler_dev_dsp::write (const void *ptr, size_t len) return len - len_s + written; } -void __stdcall +void __reg3 fhandler_dev_dsp::read (void *ptr, size_t& len) { debug_printf ("ptr=%p len=%ld", ptr, len); diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index 6b288e5f0..46a0aba58 100644 --- a/winsup/cygwin/fhandler_fifo.cc +++ b/winsup/cygwin/fhandler_fifo.cc @@ -274,7 +274,7 @@ fhandler_fifo::wait (HANDLE h) } } -void __stdcall +void __reg3 fhandler_fifo::raw_read (void *in_ptr, size_t& len) { size_t orig_len = len; diff --git a/winsup/cygwin/fhandler_floppy.cc b/winsup/cygwin/fhandler_floppy.cc index de4c13ee8..9e4b1ce1d 100644 --- a/winsup/cygwin/fhandler_floppy.cc +++ b/winsup/cygwin/fhandler_floppy.cc @@ -381,7 +381,7 @@ fhandler_dev_floppy::get_current_position () return off.QuadPart; } -void __stdcall +void __reg3 fhandler_dev_floppy::raw_read (void *ptr, size_t& ulen) { DWORD bytes_read = 0; @@ -513,7 +513,7 @@ err: ulen = (size_t) -1; } -ssize_t __stdcall +ssize_t __reg3 fhandler_dev_floppy::raw_write (const void *ptr, size_t len) { DWORD bytes_written = 0; diff --git a/winsup/cygwin/fhandler_mailslot.cc b/winsup/cygwin/fhandler_mailslot.cc index 37c41a2dd..217e3b7ee 100644 --- a/winsup/cygwin/fhandler_mailslot.cc +++ b/winsup/cygwin/fhandler_mailslot.cc @@ -146,7 +146,7 @@ fhandler_mailslot::open (int flags, mode_t mode) return res; } -ssize_t __stdcall +ssize_t __reg3 fhandler_mailslot::raw_write (const void *ptr, size_t len) { /* Check for 425/426 byte weirdness */ diff --git a/winsup/cygwin/fhandler_mem.cc b/winsup/cygwin/fhandler_mem.cc index 89c43e143..b3f8def80 100644 --- a/winsup/cygwin/fhandler_mem.cc +++ b/winsup/cygwin/fhandler_mem.cc @@ -160,7 +160,7 @@ fhandler_dev_mem::write (const void *ptr, size_t ulen) return ulen; } -void __stdcall +void __reg3 fhandler_dev_mem::read (void *ptr, size_t& ulen) { if (!ulen || pos >= (off_t) mem_size) diff --git a/winsup/cygwin/fhandler_procsys.cc b/winsup/cygwin/fhandler_procsys.cc index 6db2cd897..6bd52da27 100644 --- a/winsup/cygwin/fhandler_procsys.cc +++ b/winsup/cygwin/fhandler_procsys.cc @@ -391,7 +391,7 @@ fhandler_procsys::closedir (DIR *dir) return fhandler_virtual::closedir (dir); } -void __stdcall +void __reg3 fhandler_procsys::read (void *ptr, size_t& len) { NTSTATUS status; diff --git a/winsup/cygwin/fhandler_random.cc b/winsup/cygwin/fhandler_random.cc index d8ea2a3c8..56c8d107f 100644 --- a/winsup/cygwin/fhandler_random.cc +++ b/winsup/cygwin/fhandler_random.cc @@ -114,7 +114,7 @@ fhandler_dev_random::pseudo_read (void *ptr, size_t len) return len; } -void __stdcall +void __reg3 fhandler_dev_random::read (void *ptr, size_t& len) { if (!len) diff --git a/winsup/cygwin/fhandler_serial.cc b/winsup/cygwin/fhandler_serial.cc index 1c0f4d4f4..b6641e5e4 100644 --- a/winsup/cygwin/fhandler_serial.cc +++ b/winsup/cygwin/fhandler_serial.cc @@ -41,7 +41,7 @@ fhandler_serial::overlapped_setup () overlapped_armed = 0; } -void __stdcall +void __reg3 fhandler_serial::raw_read (void *ptr, size_t& ulen) { int tot; @@ -167,7 +167,7 @@ out: /* Cover function to WriteFile to provide Posix interface and semantics (as much as possible). */ -ssize_t __stdcall +ssize_t __reg3 fhandler_serial::raw_write (const void *ptr, size_t len) { DWORD bytes_written; diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 46cb09c03..b2a7f5c82 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -846,7 +846,7 @@ fhandler_socket::fstat (struct stat *buf) return res; } -int __stdcall +int __reg2 fhandler_socket::fstatvfs (struct statvfs *sfs) { if (get_device () == FH_UNIX) @@ -1527,7 +1527,7 @@ fhandler_socket::recv_internal (LPWSAMSG wsamsg, bool use_recvmsg) return ret; } -void __stdcall +void __reg3 fhandler_socket::read (void *in_ptr, size_t& len) { char *ptr = (char *) in_ptr; diff --git a/winsup/cygwin/fhandler_tape.cc b/winsup/cygwin/fhandler_tape.cc index 14891a2e8..b9833ffaf 100644 --- a/winsup/cygwin/fhandler_tape.cc +++ b/winsup/cygwin/fhandler_tape.cc @@ -1237,7 +1237,7 @@ fhandler_dev_tape::close () return ret ? -1 : cret; } -void __stdcall +void __reg3 fhandler_dev_tape::raw_read (void *ptr, size_t &ulen) { char *buf = (char *) ptr; @@ -1339,7 +1339,7 @@ fhandler_dev_tape::raw_read (void *ptr, size_t &ulen) unlock (); } -ssize_t __stdcall +ssize_t __reg3 fhandler_dev_tape::raw_write (const void *ptr, size_t len) { if (!_lock (true)) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index f213fe6ae..5949d0526 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -684,7 +684,7 @@ fhandler_pty_slave::write (const void *ptr, size_t len) return towrite; } -void __stdcall +void __reg3 fhandler_pty_slave::read (void *ptr, size_t& len) { ssize_t totalread = 0; @@ -1150,7 +1150,7 @@ fhandler_pty_slave::fch_close_handles () close_maybe (inuse); } -int __stdcall +int __reg1 fhandler_pty_slave::fchmod (mode_t mode) { int ret = -1; @@ -1176,7 +1176,7 @@ errout: return ret; } -int __stdcall +int __reg2 fhandler_pty_slave::fchown (uid_t uid, gid_t gid) { int ret = -1; @@ -1355,7 +1355,7 @@ fhandler_pty_master::write (const void *ptr, size_t len) return i; } -void __stdcall +void __reg3 fhandler_pty_master::read (void *ptr, size_t& len) { bg_check_types bg = bg_check (SIGTTIN); diff --git a/winsup/cygwin/fhandler_virtual.cc b/winsup/cygwin/fhandler_virtual.cc index dce98d418..07b8e4b0b 100644 --- a/winsup/cygwin/fhandler_virtual.cc +++ b/winsup/cygwin/fhandler_virtual.cc @@ -181,7 +181,7 @@ fhandler_virtual::close () return 0; } -void __stdcall +void __reg3 fhandler_virtual::read (void *ptr, size_t& len) { if (len == 0) @@ -266,7 +266,7 @@ fhandler_virtual::facl (int cmd, int nentries, aclent_t *aclbufp) return res; } -int __stdcall +int __reg2 fhandler_virtual::fstatvfs (struct statvfs *sfs) { /* Virtual file system. Just return an empty buffer with a few values diff --git a/winsup/cygwin/fhandler_windows.cc b/winsup/cygwin/fhandler_windows.cc index 2ac3bfabf..12ab5265b 100644 --- a/winsup/cygwin/fhandler_windows.cc +++ b/winsup/cygwin/fhandler_windows.cc @@ -84,7 +84,7 @@ fhandler_windows::write (const void *buf, size_t) return sizeof (MSG); } -void __stdcall +void __reg3 fhandler_windows::read (void *buf, size_t& len) { MSG *ptr = (MSG *) buf; diff --git a/winsup/cygwin/fhandler_zero.cc b/winsup/cygwin/fhandler_zero.cc index e7794f3a1..1fd874614 100644 --- a/winsup/cygwin/fhandler_zero.cc +++ b/winsup/cygwin/fhandler_zero.cc @@ -41,7 +41,7 @@ fhandler_dev_zero::write (const void *, size_t len) return len; } -void __stdcall +void __reg3 fhandler_dev_zero::read (void *ptr, size_t& len) { memset (ptr, 0, len); diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc index 521486ee7..409392760 100644 --- a/winsup/cygwin/miscfuncs.cc +++ b/winsup/cygwin/miscfuncs.cc @@ -177,7 +177,7 @@ cygwin_strupr (char *string) return string; } -int __stdcall +int __reg2 check_invalid_virtual_addr (const void *s, unsigned sz) { MEMORY_BASIC_INFORMATION mbuf; diff --git a/winsup/cygwin/ntea.cc b/winsup/cygwin/ntea.cc index c0eab1e95..3c860096e 100644 --- a/winsup/cygwin/ntea.cc +++ b/winsup/cygwin/ntea.cc @@ -30,7 +30,7 @@ details. */ #define NEXT_FEA(p) ((PFILE_FULL_EA_INFORMATION) (p->NextEntryOffset \ ? (char *) p + p->NextEntryOffset : NULL)) -ssize_t __stdcall +ssize_t __reg3 read_ea (HANDLE hdl, path_conv &pc, const char *name, char *value, size_t size) { OBJECT_ATTRIBUTES attr; @@ -216,7 +216,7 @@ out: return ret; } -int __stdcall +int __reg3 write_ea (HANDLE hdl, path_conv &pc, const char *name, const char *value, size_t size, int flags) { diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 863149916..0567a91ac 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -343,7 +343,7 @@ path_conv::add_ext_from_sym (symlink_info &sym) static void __reg2 mkrelpath (char *dst, bool caseinsensitive); -static void __stdcall +static void __reg2 mkrelpath (char *path, bool caseinsensitive) { tmp_pathbuf tp; @@ -1362,7 +1362,7 @@ normalize_win32_path (const char *src, char *dst, char *&tail) /* nofinalslash: Remove trailing / and \ from SRC (except for the first one). It is ok for src == dst. */ -void __stdcall +void __reg2 nofinalslash (const char *src, char *dst) { int len = strlen (src); @@ -2951,7 +2951,7 @@ readlink (const char *path, char *buf, size_t buflen) done during the opendir call and the hash or the filename within the directory. FIXME: Not bullet-proof. */ /* Cygwin internal */ -ino_t __stdcall +ino_t __reg2 hash_path_name (ino_t hash, PUNICODE_STRING name) { if (name->Length == 0) @@ -2965,7 +2965,7 @@ hash_path_name (ino_t hash, PUNICODE_STRING name) return hash; } -ino_t __stdcall +ino_t __reg2 hash_path_name (ino_t hash, PCWSTR name) { UNICODE_STRING uname; @@ -2973,7 +2973,7 @@ hash_path_name (ino_t hash, PCWSTR name) return hash_path_name (hash, &uname); } -ino_t __stdcall +ino_t __reg2 hash_path_name (ino_t hash, const char *name) { UNICODE_STRING uname; diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 47192462d..c92cfc10a 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -492,7 +492,7 @@ _pinfo::set_ctty (fhandler_termios *fh, int flags) /* Test to determine if a process really exists and is processing signals. */ -bool __stdcall +bool __reg1 _pinfo::exists () { return this && process_state && !(process_state & (PID_EXITED | PID_REAPED | PID_EXECED)); diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc index 1e06f9025..9159dddb0 100644 --- a/winsup/cygwin/pipe.cc +++ b/winsup/cygwin/pipe.cc @@ -394,7 +394,7 @@ fhandler_pipe::ioctl (unsigned int cmd, void *p) return 0; } -int __stdcall +int __reg2 fhandler_pipe::fstatvfs (struct statvfs *sfs) { set_errno (EBADF); diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc index 619c0c166..2d81cbd38 100644 --- a/winsup/cygwin/sec_helper.cc +++ b/winsup/cygwin/sec_helper.cc @@ -522,7 +522,7 @@ sec_acl (PACL acl, bool original, bool admins, PSID sid1, PSID sid2, DWORD acces return true; } -PSECURITY_ATTRIBUTES __stdcall +PSECURITY_ATTRIBUTES __reg3 __sec_user (PVOID sa_buf, PSID sid1, PSID sid2, DWORD access2, BOOL inherit) { PSECURITY_ATTRIBUTES psa = (PSECURITY_ATTRIBUTES) sa_buf; diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index a3f595e1a..2501c1922 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -187,7 +187,7 @@ sigprocmask (int how, const sigset_t *set, sigset_t *oldset) return res; } -int __stdcall +int __reg3 handle_sigprocmask (int how, const sigset_t *set, sigset_t *oldset, sigset_t& opmask) { /* check that how is in right range */ @@ -227,7 +227,7 @@ handle_sigprocmask (int how, const sigset_t *set, sigset_t *oldset, sigset_t& op return 0; } -int __stdcall +int __reg2 _pinfo::kill (siginfo_t& si) { int res; diff --git a/winsup/cygwin/smallprint.cc b/winsup/cygwin/smallprint.cc index 75291e713..e3e238fd9 100644 --- a/winsup/cygwin/smallprint.cc +++ b/winsup/cygwin/smallprint.cc @@ -484,7 +484,9 @@ __small_vswprintf (PWCHAR dst, const WCHAR *fmt, va_list ap) while (*fmt) { unsigned int n = 0x7fff; +#ifdef __x86_64__ bool l_opt = false; +#endif if (*fmt != L'%') *dst++ = *fmt++; else @@ -519,7 +521,9 @@ __small_vswprintf (PWCHAR dst, const WCHAR *fmt, va_list ap) len = len * 10 + (c - L'0'); continue; case L'l': +#ifdef __x86_64__ l_opt = true; +#endif continue; case L'c': case L'C': diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 5a748a42e..ae4c023ce 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -85,7 +85,7 @@ perhaps_suffix (const char *prog, path_conv& buf, int& err, unsigned opt) of name is placed in buf and returned. Otherwise the contents of buf is undefined and NULL is returned. */ -const char * __stdcall +const char * __reg3 find_exec (const char *name, path_conv& buf, const char *mywinenv, unsigned opt, const char **known_suffix) { @@ -764,7 +764,6 @@ loop: /* Name the handle similarly to proc_subproc. */ ProtectHandle1 (pi.hProcess, childhProc); - pid_t pid; if (mode == _P_OVERLAY) { myself->dwProcessId = pi.dwProcessId; @@ -772,7 +771,6 @@ loop: myself.hProcess = hExeced = pi.hProcess; real_path.get_wide_win32_path (myself->progname); // FIXME: race? sigproc_printf ("new process name %W", myself->progname); - pid = myself->pid; if (!iscygwin ()) close_all_files (); } @@ -812,7 +810,6 @@ loop: res = -1; goto out; } - pid = child->pid; } /* Start the child running */ diff --git a/winsup/cygwin/strfuncs.cc b/winsup/cygwin/strfuncs.cc index d6f5d96ab..9e5aa0304 100644 --- a/winsup/cygwin/strfuncs.cc +++ b/winsup/cygwin/strfuncs.cc @@ -410,7 +410,7 @@ __big5_mbtowc (struct _reent *r, wchar_t *pwc, const char *s, size_t n, to buffer size, it's a bug in Cygwin and the buffer in the calling function should be raised. */ -size_t __stdcall +size_t __reg3 sys_cp_wcstombs (wctomb_p f_wctomb, const char *charset, char *dst, size_t len, const wchar_t *src, size_t nwc) { @@ -496,7 +496,7 @@ sys_cp_wcstombs (wctomb_p f_wctomb, const char *charset, char *dst, size_t len, return n; } -size_t __stdcall +size_t __reg3 sys_wcstombs (char *dst, size_t len, const wchar_t * src, size_t nwc) { return sys_cp_wcstombs (cygheap->locale.wctomb, cygheap->locale.charset, @@ -513,7 +513,7 @@ sys_wcstombs (char *dst, size_t len, const wchar_t * src, size_t nwc) Note that this code is shared by cygserver (which requires it via __small_vsprintf) and so when built there plain calloc is the only choice. */ -size_t __stdcall +size_t __reg3 sys_wcstombs_alloc (char **dst_p, int type, const wchar_t *src, size_t nwc) { size_t ret; @@ -539,7 +539,7 @@ sys_wcstombs_alloc (char **dst_p, int type, const wchar_t *src, size_t nwc) conversion. This is so that fhandler_console can switch to an alternate charset, which is the charset returned by GetConsoleCP (). Most of the time this is used for box and line drawing characters. */ -size_t __stdcall +size_t __reg3 sys_cp_mbstowcs (mbtowc_p f_mbtowc, const char *charset, wchar_t *dst, size_t dlen, const char *src, size_t nms) { @@ -648,7 +648,7 @@ sys_cp_mbstowcs (mbtowc_p f_mbtowc, const char *charset, wchar_t *dst, return count; } -size_t __stdcall +size_t __reg3 sys_mbstowcs (wchar_t * dst, size_t dlen, const char *src, size_t nms) { return sys_cp_mbstowcs (cygheap->locale.mbtowc, cygheap->locale.charset, @@ -656,7 +656,7 @@ sys_mbstowcs (wchar_t * dst, size_t dlen, const char *src, size_t nms) } /* Same as sys_wcstombs_alloc, just backwards. */ -size_t __stdcall +size_t __reg3 sys_mbstowcs_alloc (wchar_t **dst_p, int type, const char *src, size_t nms) { size_t ret; diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index b73b9fb31..a8ca9efab 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1847,7 +1847,7 @@ sync () } /* Cygwin internal */ -int __stdcall +int __reg2 stat_worker (path_conv &pc, struct stat *buf) { int res = -1; diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 2e54b7a50..0d5ded675 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -38,8 +38,8 @@ extern "C" void __fp_lock_all (); extern "C" void __fp_unlock_all (); extern "C" int valid_sched_parameters(const struct sched_param *); extern "C" int sched_set_thread_priority(HANDLE thread, int priority); -#ifdef __x86_64__ -/* FIXME: Temporarily workaround gcc 4.8 bug. */ +#if __GNUC__ == 4 && __GNUC_MINOR__ >= 7 +/* FIXME: Temporarily workaround gcc 4.7+ bug. */ static verifyable_object_state #else static inline verifyable_object_state @@ -122,8 +122,8 @@ __cygwin_lock_unlock (_LOCK_T *lock) paranoid_printf ("threadcount %d. unlocked", MT_INTERFACE->threadcount); } -#ifdef __x86_64__ -/* FIXME: Temporarily workaround gcc 4.8 bug. */ +#if __GNUC__ == 4 && __GNUC_MINOR__ >= 7 +/* FIXME: Temporarily workaround gcc 4.7+ bug. */ static verifyable_object_state #else static inline verifyable_object_state diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc index d27300bd0..7388ac1a3 100644 --- a/winsup/cygwin/tty.cc +++ b/winsup/cygwin/tty.cc @@ -85,7 +85,7 @@ tty::init_session () cygheap->fdtab.get_debugger_info (); } -int __stdcall +int __reg2 tty_list::attach (int n) { int res; diff --git a/winsup/cygwin/window.cc b/winsup/cygwin/window.cc index 27d8b4a4f..ce9a7c708 100644 --- a/winsup/cygwin/window.cc +++ b/winsup/cygwin/window.cc @@ -26,7 +26,7 @@ wininfo NO_COPY winmsg; muto NO_COPY wininfo::_lock; -int __stdcall +int __reg3 wininfo::process (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { #ifndef NOSTRACE @@ -57,7 +57,7 @@ process_window_events (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } /* Handle windows events. Inherits ownership of the wininfo lock */ -DWORD WINAPI +DWORD __reg1 WINAPI wininfo::winthread () { MSG msg;