From f2010ed78479b1b6b4518ea79acb6cd36514344f Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 7 Mar 2024 21:50:07 +0100 Subject: [PATCH] Cygwin: move EXPORT_ALIAS expressions to end of source 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. Signed-off-by: Corinna Vinschen --- 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 2f4041329..0e6e535d8 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 */ 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 ddba6fb94..d33cffada 100644 --- a/winsup/cygwin/random.cc +++ b/winsup/cygwin/random.cc @@ -293,8 +293,6 @@ srandom(unsigned x) __random_unlock(); } -EXPORT_ALIAS (srandom, srand) - /* * initstate: * @@ -490,3 +488,5 @@ rand() } } + +EXPORT_ALIAS (srandom, srand) diff --git a/winsup/cygwin/sched.cc b/winsup/cygwin/sched.cc index 845fcef57..71a1e868f 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) int sched_getcpu () @@ -696,4 +695,5 @@ __cpuset_free (cpu_set_t *set) free (set); } +EXPORT_ALIAS (sched_yield, pthread_yield) } /* extern C */ diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 2c5bf7cbe..df7d3a14e 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; } -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; } -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; } -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; } -EXPORT_ALIAS (lseek, _lseek) - extern "C" int close (int fd) { @@ -1709,8 +1701,6 @@ close (int fd) return res; } -EXPORT_ALIAS (close, _close) - extern "C" int isatty (int fd) { @@ -1724,7 +1714,6 @@ isatty (int fd) syscall_printf ("%R = isatty(%d)", res, fd); return res; } -EXPORT_ALIAS (isatty, _isatty) extern "C" int link (const char *oldpath, const char *newpath) @@ -1977,8 +1966,6 @@ fsync (int fd) return cfd->fsync (); } -EXPORT_ALIAS (fsync, fdatasync) - static void sync_worker (HANDLE dir, USHORT len, LPCWSTR vol) { @@ -4071,8 +4058,6 @@ utmpname (const char *file) return -1; } -EXPORT_ALIAS (utmpname, utmpxname) - /* Note: do not make NO_COPY */ static struct utmp utmp_data_buf[16]; static unsigned utix = 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 71a721031..f6e2692b5 100644 --- a/winsup/cygwin/times.cc +++ b/winsup/cygwin/times.cc @@ -91,8 +91,6 @@ times (struct tms *buf) return tc; } -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 *__restrict tzvp) return 0; } -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/tzcode/localtime_wrapper.c index 4e784480b..41a5bcb63 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" // Don't forget these Cygwin-specific additions from this point to EOF -EXPORT_ALIAS (tzset_unlocked, _tzset_unlocked) 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) -- 2.11.4.GIT