From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 75B0C3858D35; Thu, 7 Mar 2024 20:50:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75B0C3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1709844619; bh=u8Otzj4jp3m0T2k7Q2Kq0ePE08n9qrUq+hgDnJSlEPs=; h=From:To:Subject:Date:From; b=YSiKZdIXjV+HvStgmDJu1Ykszs/n4paEI+e3ElPCSjXJnsSUth1pXVRNn+9olQDJy AVtI0rgi/O4B6n7qT8sRpwLxgNgzAii0Bzh6trSk8FvC2fubbPke/X/c2zXTHsS5zd AYw0YyPhubjx6rk6k8GWuMKQMgMYQPn/twMVi/ns= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: move EXPORT_ALIAS expressions to end of source X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: c2310061c66a100653fe10762859b8adb6a3d357 X-Git-Newrev: f2010ed78479b1b6b4518ea79acb6cd36514344f Message-Id: <20240307205019.75B0C3858D35@sourceware.org> Date: Thu, 7 Mar 2024 20:50:19 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Df2010ed7847= 9b1b6b4518ea79acb6cd36514344f commit f2010ed78479b1b6b4518ea79acb6cd36514344f Author: Corinna Vinschen AuthorDate: Thu Mar 7 21:50:07 2024 +0100 Commit: Corinna Vinschen CommitDate: Thu Mar 7 21:50:07 2024 +0100 Cygwin: move EXPORT_ALIAS expressions to end of source =20 This isn't strictly required, but it avoids confusion in ctags. Ctags fails to record the next function or method following the EXPORT_ALIAS expression. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/exec.cc | 3 ++- winsup/cygwin/random.cc | 4 ++-- winsup/cygwin/sched.cc | 2 +- winsup/cygwin/syscalls.cc | 24 +++++++++--------------- winsup/cygwin/times.cc | 7 +++---- winsup/cygwin/tzcode/localtime_wrapper.c | 3 ++- 6 files changed, 19 insertions(+), 24 deletions(-) diff --git a/winsup/cygwin/exec.cc b/winsup/cygwin/exec.cc index 2f4041329a65..0e6e535d86cf 100644 --- a/winsup/cygwin/exec.cc +++ b/winsup/cygwin/exec.cc @@ -85,7 +85,6 @@ execve (const char *path, char *const argv[], char *const= envp[]) { return spawnve (_P_OVERLAY, path, argv, envp); } -EXPORT_ALIAS (execve, _execve) /* For newlib */ =20 extern "C" int execvp (const char *file, char * const *argv) @@ -126,3 +125,5 @@ sexecve_is_bad () set_errno (ENOSYS); return 0; } + +EXPORT_ALIAS (execve, _execve) /* For newlib */ diff --git a/winsup/cygwin/random.cc b/winsup/cygwin/random.cc index ddba6fb944ec..d33cffada0f0 100644 --- a/winsup/cygwin/random.cc +++ b/winsup/cygwin/random.cc @@ -293,8 +293,6 @@ srandom(unsigned x) __random_unlock(); } =20 -EXPORT_ALIAS (srandom, srand) - /* * initstate: * @@ -490,3 +488,5 @@ rand() } =20 } + +EXPORT_ALIAS (srandom, srand) diff --git a/winsup/cygwin/sched.cc b/winsup/cygwin/sched.cc index 845fcef5702c..71a1e868f9b4 100644 --- a/winsup/cygwin/sched.cc +++ b/winsup/cygwin/sched.cc @@ -411,7 +411,6 @@ sched_yield () SwitchToThread (); return 0; } -EXPORT_ALIAS (sched_yield, pthread_yield) =20 int sched_getcpu () @@ -696,4 +695,5 @@ __cpuset_free (cpu_set_t *set) free (set); } =20 +EXPORT_ALIAS (sched_yield, pthread_yield) } /* extern C */ diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 2c5bf7cbe08b..df7d3a14efd4 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1282,8 +1282,6 @@ read (int fd, void *ptr, size_t len) return (ssize_t) res; } =20 -EXPORT_ALIAS (read, _read) - extern "C" ssize_t readv (int fd, const struct iovec *const iov, const int iovcnt) { @@ -1380,8 +1378,6 @@ write (int fd, const void *ptr, size_t len) return res; } =20 -EXPORT_ALIAS (write, _write) - extern "C" ssize_t writev (const int fd, const struct iovec *const iov, const int iovcnt) { @@ -1594,8 +1590,6 @@ open (const char *unix_path, int flags, ...) return res; } =20 -EXPORT_ALIAS (open, _open ) - static int posix_getdents_lseek (cygheap_fdget &cfd, off_t pos, int dir) { @@ -1684,8 +1678,6 @@ lseek (int fd, off_t pos, int dir) return res; } =20 -EXPORT_ALIAS (lseek, _lseek) - extern "C" int close (int fd) { @@ -1709,8 +1701,6 @@ close (int fd) return res; } =20 -EXPORT_ALIAS (close, _close) - extern "C" int isatty (int fd) { @@ -1724,7 +1714,6 @@ isatty (int fd) syscall_printf ("%R =3D isatty(%d)", res, fd); return res; } -EXPORT_ALIAS (isatty, _isatty) =20 extern "C" int link (const char *oldpath, const char *newpath) @@ -1977,8 +1966,6 @@ fsync (int fd) return cfd->fsync (); } =20 -EXPORT_ALIAS (fsync, fdatasync) - static void sync_worker (HANDLE dir, USHORT len, LPCWSTR vol) { @@ -4071,8 +4058,6 @@ utmpname (const char *file) return -1; } =20 -EXPORT_ALIAS (utmpname, utmpxname) - /* Note: do not make NO_COPY */ static struct utmp utmp_data_buf[16]; static unsigned utix =3D 0; @@ -5128,3 +5113,12 @@ tmpfile (void) set_errno (e); return fp; } + +EXPORT_ALIAS (close, _close) +EXPORT_ALIAS (fsync, fdatasync) +EXPORT_ALIAS (isatty, _isatty) +EXPORT_ALIAS (lseek, _lseek) +EXPORT_ALIAS (open, _open) +EXPORT_ALIAS (read, _read) +EXPORT_ALIAS (utmpname, utmpxname) +EXPORT_ALIAS (write, _write) diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc index 71a7210318fa..f6e2692b598c 100644 --- a/winsup/cygwin/times.cc +++ b/winsup/cygwin/times.cc @@ -91,8 +91,6 @@ times (struct tms *buf) return tc; } =20 -EXPORT_ALIAS (times, _times) - /* settimeofday: BSD */ extern "C" int settimeofday (const struct timeval *tv, const struct timezone *tz) @@ -192,8 +190,6 @@ gettimeofday (struct timeval *__restrict tv, void *__re= strict tzvp) return 0; } =20 -EXPORT_ALIAS (gettimeofday, _gettimeofday) - /* Cygwin internal */ void timespec_to_filetime (const struct timespec *time_in, PLARGE_INTEGER out) @@ -571,3 +567,6 @@ timespec_get (struct timespec *ts, int base) clock_gettime (CLOCK_REALTIME, ts); return base; } + +EXPORT_ALIAS (gettimeofday, _gettimeofday) +EXPORT_ALIAS (times, _times) diff --git a/winsup/cygwin/tzcode/localtime_wrapper.c b/winsup/cygwin/tzcod= e/localtime_wrapper.c index 4e784480b0f4..41a5bcb63cc9 100644 --- a/winsup/cygwin/tzcode/localtime_wrapper.c +++ b/winsup/cygwin/tzcode/localtime_wrapper.c @@ -124,7 +124,6 @@ tzgetwintzi (char *wildabbr, char *outbuf) #include "localtime.patched.c" =20 // Don't forget these Cygwin-specific additions from this point to EOF -EXPORT_ALIAS (tzset_unlocked, _tzset_unlocked) =20 long __cygwin_gettzoffset (const struct tm *tmp) @@ -150,3 +149,5 @@ __cygwin_gettzname (const struct tm *tmp) #endif return _tzname[tmp->tm_isdst > 0]; } + +EXPORT_ALIAS (tzset_unlocked, _tzset_unlocked)