4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-07 06:50:24 +08:00

cygwin: convert most #ifndef __x86_64__ to #ifdef __i386__

Address the real offender

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2017-11-27 14:36:06 +01:00
parent bc14f1c174
commit 76f06705be
27 changed files with 140 additions and 140 deletions

View File

@ -401,7 +401,7 @@ __attribute__ ((used, noinline)) static two_addr_t
std_dll_init () std_dll_init ()
#endif #endif
{ {
#ifndef __x86_64__ #ifdef __i386__
struct func_info *func = (struct func_info *) __builtin_return_address (0); struct func_info *func = (struct func_info *) __builtin_return_address (0);
#endif #endif
struct dll_info *dll = func->dll; struct dll_info *dll = func->dll;
@ -453,7 +453,7 @@ std_dll_init ()
InterlockedDecrement (&dll->here); InterlockedDecrement (&dll->here);
#ifndef __x86_64__ #ifdef __i386__
/* Kludge alert. Redirects the return address to dll_chain. */ /* Kludge alert. Redirects the return address to dll_chain. */
uintptr_t *volatile frame = (uintptr_t *) __builtin_frame_address (0); uintptr_t *volatile frame = (uintptr_t *) __builtin_frame_address (0);
frame[1] = (uintptr_t) dll_chain; frame[1] = (uintptr_t) dll_chain;
@ -480,7 +480,7 @@ wsock_init ()
See the git log for a description. */ See the git log for a description. */
static WSADATA NO_COPY wsadata; static WSADATA NO_COPY wsadata;
static LONG NO_COPY here = -1L; static LONG NO_COPY here = -1L;
#ifndef __x86_64__ #ifdef __i386__
struct func_info *func = (struct func_info *) __builtin_return_address (0); struct func_info *func = (struct func_info *) __builtin_return_address (0);
#endif #endif
struct dll_info *dll = func->dll; struct dll_info *dll = func->dll;
@ -514,7 +514,7 @@ wsock_init ()
} }
} }
#ifndef __x86_64__ #ifdef __i386__
/* Kludge alert. Redirects the return address to dll_chain. */ /* Kludge alert. Redirects the return address to dll_chain. */
uintptr_t *volatile frame = (uintptr_t *) __builtin_frame_address (0); uintptr_t *volatile frame = (uintptr_t *) __builtin_frame_address (0);
frame[1] = (uintptr_t) dll_chain; frame[1] = (uintptr_t) dll_chain;

View File

@ -390,7 +390,7 @@ check_sanity_and_sync (per_process *p)
api_fatal ("cygwin DLL and APP are out of sync -- API version mismatch %u > %u", api_fatal ("cygwin DLL and APP are out of sync -- API version mismatch %u > %u",
p->api_major, cygwin_version.api_major); p->api_major, cygwin_version.api_major);
#ifndef __x86_64__ #ifdef __i386__
/* This is a kludge to work around a version of _cygwin_common_crt0 /* This is a kludge to work around a version of _cygwin_common_crt0
which overwrote the cxx_malloc field with the local DLL copy. which overwrote the cxx_malloc field with the local DLL copy.
Hilarity ensues if the DLL is not loaded while the process Hilarity ensues if the DLL is not loaded while the process
@ -712,7 +712,7 @@ init_windows_system_directory ()
api_fatal ("can't find windows system directory"); api_fatal ("can't find windows system directory");
windows_system_directory[windows_system_directory_length++] = L'\\'; windows_system_directory[windows_system_directory_length++] = L'\\';
windows_system_directory[windows_system_directory_length] = L'\0'; windows_system_directory[windows_system_directory_length] = L'\0';
#ifndef __x86_64__ #ifdef __i386__
system_wow64_directory_length = system_wow64_directory_length =
GetSystemWow64DirectoryW (system_wow64_directory, MAX_PATH); GetSystemWow64DirectoryW (system_wow64_directory, MAX_PATH);
if (system_wow64_directory_length) if (system_wow64_directory_length)
@ -720,7 +720,7 @@ init_windows_system_directory ()
system_wow64_directory[system_wow64_directory_length++] = L'\\'; system_wow64_directory[system_wow64_directory_length++] = L'\\';
system_wow64_directory[system_wow64_directory_length] = L'\0'; system_wow64_directory[system_wow64_directory_length] = L'\0';
} }
#endif /* !__x86_64__ */ #endif /* __i386__ */
} }
} }
@ -1103,14 +1103,14 @@ dll_crt0 (per_process *uptr)
extern "C" void extern "C" void
cygwin_dll_init () cygwin_dll_init ()
{ {
#ifndef __x86_64__ #ifdef __i386__
static char **envp; static char **envp;
#endif #endif
static int _fmode; static int _fmode;
user_data->magic_biscuit = sizeof (per_process); user_data->magic_biscuit = sizeof (per_process);
#ifndef __x86_64__ #ifdef __i386__
user_data->envptr = &envp; user_data->envptr = &envp;
#endif #endif
user_data->fmode_ptr = &_fmode; user_data->fmode_ptr = &_fmode;

View File

@ -273,7 +273,7 @@ dlopen (const char *name, int flags)
break; break;
} }
#ifndef __x86_64__ #ifdef __i386__
/* Workaround for broken DLLs built against Cygwin versions 1.7.0-49 /* Workaround for broken DLLs built against Cygwin versions 1.7.0-49
up to 1.7.0-57. They override the cxx_malloc pointer in their up to 1.7.0-57. They override the cxx_malloc pointer in their
DLL initialization code even if loaded dynamically. This is a DLL initialization code even if loaded dynamically. This is a
@ -300,7 +300,7 @@ dlopen (const char *name, int flags)
++d->count; ++d->count;
} }
#ifndef __x86_64__ #ifdef __i386__
/* Restore original cxx_malloc pointer. */ /* Restore original cxx_malloc pointer. */
__cygwin_user_data.cxx_malloc = tmp_malloc; __cygwin_user_data.cxx_malloc = tmp_malloc;
#endif #endif

View File

@ -84,7 +84,7 @@ dll::init ()
{ {
int ret = 1; int ret = 1;
#ifndef __x86_64__ #ifdef __i386__
/* This should be a no-op. Why didn't we just import this variable? */ /* This should be a no-op. Why didn't we just import this variable? */
if (!p.envptr) if (!p.envptr)
p.envptr = &__cygwin_environ; p.envptr = &__cygwin_environ;
@ -243,7 +243,7 @@ dll_list::alloc (HINSTANCE h, per_process *p, dll_type type)
loaded_dlls++; loaded_dlls++;
} }
guard (false); guard (false);
#ifndef __x86_64__ #ifdef __i386__
assert (p->envptr != NULL); assert (p->envptr != NULL);
#endif #endif
return d; return d;
@ -725,7 +725,7 @@ dll_dllcrt0_1 (VOID *x)
res = (PVOID) d; res = (PVOID) d;
} }
#ifndef __x86_64__ #ifdef __i386__
/* OBSOLETE: This function is obsolete and will go away in the /* OBSOLETE: This function is obsolete and will go away in the
future. Cygwin can now handle being loaded from a noncygwin app future. Cygwin can now handle being loaded from a noncygwin app
using the same entry point. */ using the same entry point. */
@ -734,7 +734,7 @@ dll_noncygwin_dllcrt0 (HMODULE h, per_process *p)
{ {
return (int) dll_dllcrt0 (h, p); return (int) dll_dllcrt0 (h, p);
} }
#endif /* !__x86_64__ */ #endif /* __i386__ */
extern "C" void extern "C" void
cygwin_detach_dll (dll *) cygwin_detach_dll (dll *)
@ -753,7 +753,7 @@ dlfork (int val)
dlls.reload_on_fork = val; dlls.reload_on_fork = val;
} }
#ifndef __x86_64__ #ifdef __i386__
/* Called from various places to update all of the individual /* Called from various places to update all of the individual
ideas of the environ block. Explain to me again why we didn't ideas of the environ block. Explain to me again why we didn't
just import __cygwin_environ? */ just import __cygwin_environ? */

View File

@ -8,7 +8,7 @@ details. */
struct per_module struct per_module
{ {
#ifndef __x86_64__ #ifdef __i386__
char ***envptr; char ***envptr;
#endif #endif
void (**ctors)(void); void (**ctors)(void);
@ -20,7 +20,7 @@ struct per_module
int (*main)(int, char **, char **); int (*main)(int, char **, char **);
per_module &operator = (per_process *p) per_module &operator = (per_process *p)
{ {
#ifndef __x86_64__ #ifdef __i386__
envptr = p->envptr; envptr = p->envptr;
#endif #endif
ctors = p->ctors; ctors = p->ctors;

View File

@ -1260,7 +1260,7 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
return newenv; return newenv;
} }
#ifndef __x86_64__ #ifdef __i386__
/* This idiocy is necessary because the early implementers of cygwin /* This idiocy is necessary because the early implementers of cygwin
did not seem to know about importing data variables from the DLL. did not seem to know about importing data variables from the DLL.
So, we have to synchronize cygwin's idea of the environment with the So, we have to synchronize cygwin's idea of the environment with the

View File

@ -6,7 +6,7 @@ details. */
#pragma once #pragma once
#ifndef __x86_64__ #ifdef __i386__
/* Documentation on the innards of 32 bit Windows exception handling (i.e. /* Documentation on the innards of 32 bit Windows exception handling (i.e.
from the perspective of a compiler implementor) apparently doesn't exist. from the perspective of a compiler implementor) apparently doesn't exist.
However, the following came from Onno Hovers <onno@stack.urc.tue.nl> However, the following came from Onno Hovers <onno@stack.urc.tue.nl>
@ -123,7 +123,7 @@ public:
~exception () __attribute__ ((always_inline)) { _except_list = save; } ~exception () __attribute__ ((always_inline)) { _except_list = save; }
}; };
#else /* __x86_64__ */ #else /* !__i386__ */
#define exception_list void #define exception_list void
typedef struct _DISPATCHER_CONTEXT *PDISPATCHER_CONTEXT; typedef struct _DISPATCHER_CONTEXT *PDISPATCHER_CONTEXT;
@ -159,7 +159,7 @@ public:
LONG CALLBACK myfault_altstack_handler (EXCEPTION_POINTERS *); LONG CALLBACK myfault_altstack_handler (EXCEPTION_POINTERS *);
#endif /* !__x86_64__ */ #endif /* __i386__ */
class cygwin_exception class cygwin_exception
{ {

View File

@ -434,7 +434,7 @@ _cygtls::inside_kernel (CONTEXT *cx)
checkdir += 4; checkdir += 4;
res = wcsncasecmp (windows_system_directory, checkdir, res = wcsncasecmp (windows_system_directory, checkdir,
windows_system_directory_length) == 0; windows_system_directory_length) == 0;
#ifndef __x86_64__ #ifdef __i386__
if (!res && system_wow64_directory_length) if (!res && system_wow64_directory_length)
res = wcsncasecmp (system_wow64_directory, checkdir, res = wcsncasecmp (system_wow64_directory, checkdir,
system_wow64_directory_length) == 0; system_wow64_directory_length) == 0;
@ -628,7 +628,7 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in,
static int NO_COPY debugging = 0; static int NO_COPY debugging = 0;
_cygtls& me = _my_tls; _cygtls& me = _my_tls;
#ifndef __x86_64__ #ifdef __i386__
if (me.andreas) if (me.andreas)
me.andreas->leave (); /* Return from a "san" caught fault */ me.andreas->leave (); /* Return from a "san" caught fault */
#endif #endif

View File

@ -242,7 +242,7 @@ cygwin_internal (cygwin_getinfo_types t, ...)
break; break;
case CW_USER_DATA: case CW_USER_DATA:
#ifndef __x86_64__ #ifdef __i386__
/* This is a kludge to work around a version of _cygwin_common_crt0 /* This is a kludge to work around a version of _cygwin_common_crt0
which overwrote the cxx_malloc field with the local DLL copy. which overwrote the cxx_malloc field with the local DLL copy.
Hilarity ensues if the DLL is not loaded like while the process Hilarity ensues if the DLL is not loaded like while the process

View File

@ -79,10 +79,7 @@ fcntl64 (int fd, int cmd, ...)
return res; return res;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (fcntl64, fcntl)
EXPORT_ALIAS (fcntl64, _fcntl)
#else
extern "C" int extern "C" int
_fcntl (int fd, int cmd, ...) _fcntl (int fd, int cmd, ...)
{ {
@ -121,4 +118,7 @@ _fcntl (int fd, int cmd, ...)
__endtry __endtry
return -1; return -1;
} }
#else
EXPORT_ALIAS (fcntl64, fcntl)
EXPORT_ALIAS (fcntl64, _fcntl)
#endif #endif

View File

@ -23,10 +23,10 @@ HMODULE NO_COPY hntdll;
int NO_COPY sigExeced; int NO_COPY sigExeced;
WCHAR windows_system_directory[MAX_PATH]; WCHAR windows_system_directory[MAX_PATH];
UINT windows_system_directory_length; UINT windows_system_directory_length;
#ifndef __x86_64__ #ifdef __i386__
WCHAR system_wow64_directory[MAX_PATH]; WCHAR system_wow64_directory[MAX_PATH];
UINT system_wow64_directory_length; UINT system_wow64_directory_length;
#endif /* !__x86_64__ */ #endif /* __i386__ */
WCHAR global_progname[NT_MAX_PATH]; WCHAR global_progname[NT_MAX_PATH];
/* program exit the program */ /* program exit the program */
@ -154,7 +154,7 @@ const int __collate_load_error = 0;
/* This is an exported copy of environ which can be used by DLLs /* This is an exported copy of environ which can be used by DLLs
which use cygwin.dll. */ which use cygwin.dll. */
char **__cygwin_environ; char **__cygwin_environ;
#ifndef __x86_64__ #ifdef __i386__
char ***main_environ = &__cygwin_environ; char ***main_environ = &__cygwin_environ;
#endif #endif
/* __progname used in getopt error message */ /* __progname used in getopt error message */
@ -167,7 +167,7 @@ const int __collate_load_error = 0;
/* dll_major */ CYGWIN_VERSION_DLL_MAJOR, /* dll_major */ CYGWIN_VERSION_DLL_MAJOR,
/* dll_major */ CYGWIN_VERSION_DLL_MINOR, /* dll_major */ CYGWIN_VERSION_DLL_MINOR,
/* impure_ptr_ptr */ NULL, /* impure_ptr_ptr */ NULL,
#ifndef __x86_64__ #ifdef __i386__
/* envptr */ NULL, /* envptr */ NULL,
#endif #endif
/* malloc */ malloc, /* free */ free, /* malloc */ malloc, /* free */ free,

View File

@ -237,7 +237,7 @@ internal_getgrgid (gid_t gid, cyg_ldap *pldap)
return NULL; return NULL;
} }
#ifndef __x86_64__ #ifdef __i386__
static struct __group16 * static struct __group16 *
grp32togrp16 (struct __group16 *gp16, struct group *gp32) grp32togrp16 (struct __group16 *gp16, struct group *gp32)
{ {
@ -837,9 +837,7 @@ setgroups32 (int ngroups, const gid_t *grouplist)
return 0; return 0;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (setgroups32, setgroups)
#else
extern "C" int extern "C" int
setgroups (int ngroups, const __gid16_t *grouplist) setgroups (int ngroups, const __gid16_t *grouplist)
{ {
@ -855,4 +853,6 @@ setgroups (int ngroups, const __gid16_t *grouplist)
} }
return setgroups32 (ngroups, grouplist32); return setgroups32 (ngroups, grouplist32);
} }
#else
EXPORT_ALIAS (setgroups32, setgroups)
#endif #endif

View File

@ -391,7 +391,7 @@ typedef struct
uint32_t bsize; /* uninitialized data " " */ uint32_t bsize; /* uninitialized data " " */
uint32_t entry; /* entry pt. */ uint32_t entry; /* entry pt. */
uint32_t text_start; /* base of text used for this file */ uint32_t text_start; /* base of text used for this file */
#ifndef __x86_64__ #ifdef __i386__
uint32_t data_start; /* base of all data used for this file */ uint32_t data_start; /* base of all data used for this file */
#endif #endif

View File

@ -17,7 +17,7 @@ extern "C" {
#endif #endif
#ifdef __INSIDE_CYGWIN__ #ifdef __INSIDE_CYGWIN__
#ifndef __x86_64__ #ifdef __i386__
struct __group16 struct __group16
{ {
char *gr_name; char *gr_name;

View File

@ -33,7 +33,7 @@ struct stat
}; };
#if defined (__INSIDE_CYGWIN__) || defined (_COMPILING_NEWLIB) #if defined (__INSIDE_CYGWIN__) || defined (_COMPILING_NEWLIB)
#ifndef __x86_64__ #ifdef __i386__
struct __stat32 struct __stat32
{ {
__dev16_t st_dev; __dev16_t st_dev;

View File

@ -20,7 +20,7 @@ extern "C" {
#define _CYGWIN_SIGNAL_STRING "cYgSiGw00f" #define _CYGWIN_SIGNAL_STRING "cYgSiGw00f"
#ifndef __x86_64__ #ifdef __i386__
/* DEPRECATED INTERFACES. These are restricted to MAX_PATH length. /* DEPRECATED INTERFACES. These are restricted to MAX_PATH length.
Don't use in modern applications. They don't exist on x86_64. */ Don't use in modern applications. They don't exist on x86_64. */
extern int cygwin_win32_to_posix_path_list (const char *, char *) extern int cygwin_win32_to_posix_path_list (const char *, char *)
@ -39,7 +39,7 @@ extern int cygwin_conv_to_posix_path (const char *, char *)
__attribute__ ((__deprecated__)); __attribute__ ((__deprecated__));
extern int cygwin_conv_to_full_posix_path (const char *, char *) extern int cygwin_conv_to_full_posix_path (const char *, char *)
__attribute__ ((__deprecated__)); __attribute__ ((__deprecated__));
#endif /* !__x86_64__ */ #endif /* __i386__ */
/* Use these interfaces in favor of the above. */ /* Use these interfaces in favor of the above. */
@ -310,7 +310,7 @@ struct per_process
uint32_t dll_minor; uint32_t dll_minor;
struct _reent **impure_ptr_ptr; struct _reent **impure_ptr_ptr;
#ifndef __x86_64__ #ifdef __i386__
char ***envptr; char ***envptr;
#endif #endif

View File

@ -15,7 +15,7 @@
#define __DIRENT_VERSION 2 #define __DIRENT_VERSION 2
#ifndef __x86_64__ #ifdef __i386__
#pragma pack(push,4) #pragma pack(push,4)
#endif #endif
#define _DIRENT_HAVE_D_TYPE #define _DIRENT_HAVE_D_TYPE
@ -28,7 +28,7 @@ struct dirent
__uint32_t __d_internal1; __uint32_t __d_internal1;
char d_name[NAME_MAX + 1]; char d_name[NAME_MAX + 1];
}; };
#ifndef __x86_64__ #ifdef __i386__
#pragma pack(pop) #pragma pack(pop)
#endif #endif
@ -40,7 +40,7 @@ struct dirent
#define __DIRENT_COOKIE 0xdede4242 #define __DIRENT_COOKIE 0xdede4242
#endif #endif
#ifndef __x86_64__ #ifdef __i386__
#pragma pack(push,4) #pragma pack(push,4)
#endif #endif
typedef struct __DIR typedef struct __DIR
@ -56,7 +56,7 @@ typedef struct __DIR
void *__fh; void *__fh;
unsigned __flags; unsigned __flags;
} DIR; } DIR;
#ifndef __x86_64__ #ifdef __i386__
#pragma pack(pop) #pragma pack(pop)
#endif #endif

View File

@ -61,7 +61,7 @@ extern int __dynamically_loaded;
extern "C" extern "C"
{ {
#ifndef __x86_64__ #ifdef __i386__
char **environ; char **environ;
#endif #endif
int _fmode; int _fmode;
@ -114,7 +114,7 @@ _cygwin_crt0_common (MainFunc f, per_process *u)
u->ctors = &__CTOR_LIST__; u->ctors = &__CTOR_LIST__;
u->dtors = &__DTOR_LIST__; u->dtors = &__DTOR_LIST__;
#ifndef __x86_64__ #ifdef __i386__
u->envptr = &environ; u->envptr = &environ;
#endif #endif
if (uwasnull) if (uwasnull)

View File

@ -399,7 +399,7 @@ pthread_wrapper (PVOID arg)
/* Initialize new _cygtls. */ /* Initialize new _cygtls. */
_my_tls.init_thread (wrapper_arg.stackbase - CYGTLS_PADSIZE, _my_tls.init_thread (wrapper_arg.stackbase - CYGTLS_PADSIZE,
(DWORD (*)(void*, void*)) wrapper_arg.func); (DWORD (*)(void*, void*)) wrapper_arg.func);
#ifndef __x86_64__ #ifdef __i386__
/* Copy exception list over to new stack. I'm not quite sure how the /* Copy exception list over to new stack. I'm not quite sure how the
exception list is extended by Windows itself. What's clear is that it exception list is extended by Windows itself. What's clear is that it
always grows downwards and that it starts right at the stackbase. always grows downwards and that it starts right at the stackbase.

View File

@ -1065,7 +1065,7 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, off_t off)
Note that this isn't done in 64 bit environments since apparently Note that this isn't done in 64 bit environments since apparently
64 bit systems don't support the AT_ROUND_TO_PAGE flag, which is 64 bit systems don't support the AT_ROUND_TO_PAGE flag, which is
required to get this right. Too bad. */ required to get this right. Too bad. */
#ifndef __x86_64__ #ifdef __i386__
if (!wincap.is_wow64 () if (!wincap.is_wow64 ()
&& (((off_t) len > fsiz && !autogrow (flags)) && (((off_t) len > fsiz && !autogrow (flags))
|| roundup2 (len, wincap.page_size ()) || roundup2 (len, wincap.page_size ())
@ -1228,14 +1228,14 @@ out:
return ret; return ret;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (mmap64, mmap)
#else
extern "C" void * extern "C" void *
mmap (void *addr, size_t len, int prot, int flags, int fd, _off_t off) mmap (void *addr, size_t len, int prot, int flags, int fd, _off_t off)
{ {
return mmap64 (addr, len, prot, flags, fd, (off_t)off); return mmap64 (addr, len, prot, flags, fd, (off_t)off);
} }
#else
EXPORT_ALIAS (mmap64, mmap)
#endif #endif
/* munmap () removes all mmapped pages between addr and addr+len. */ /* munmap () removes all mmapped pages between addr and addr+len. */

View File

@ -225,14 +225,14 @@ getpwuid32 (uid_t uid)
return getpw_cp (temppw); return getpw_cp (temppw);
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (getpwuid32, getpwuid)
#else
extern "C" struct passwd * extern "C" struct passwd *
getpwuid (__uid16_t uid) getpwuid (__uid16_t uid)
{ {
return getpwuid32 (uid16touid32 (uid)); return getpwuid32 (uid16touid32 (uid));
} }
#else
EXPORT_ALIAS (getpwuid32, getpwuid)
#endif #endif
extern "C" int extern "C" int
@ -754,7 +754,7 @@ endpwent_filtered (void *pw)
((pw_ent *) pw)->endpwent (); ((pw_ent *) pw)->endpwent ();
} }
#ifndef __x86_64__ #ifdef __i386__
extern "C" struct passwd * extern "C" struct passwd *
getpwduid (__uid16_t) getpwduid (__uid16_t)
{ {

View File

@ -3551,7 +3551,7 @@ cygwin_create_path (cygwin_conv_path_t what, const void *from)
return to; return to;
} }
#ifndef __x86_64__ /* Disable deprecated functions on x86_64. */ #ifdef __i386__
extern "C" int extern "C" int
cygwin_conv_to_win32_path (const char *path, char *win32_path) cygwin_conv_to_win32_path (const char *path, char *win32_path)
@ -3583,7 +3583,7 @@ cygwin_conv_to_full_posix_path (const char *path, char *posix_path)
MAX_PATH); MAX_PATH);
} }
#endif /* !__x86_64__ */ #endif /* __i386__ */
/* The realpath function is required by POSIX:2008. */ /* The realpath function is required by POSIX:2008. */
@ -3733,7 +3733,7 @@ env_PATH_to_posix (const void *win32, void *posix, size_t size)
size, ENV_CVT)); size, ENV_CVT));
} }
#ifndef __x86_64__ /* Disable deprecated functions on x86_64. */ #ifdef __i386__
extern "C" int extern "C" int
cygwin_win32_to_posix_path_list_buf_size (const char *path_list) cygwin_win32_to_posix_path_list_buf_size (const char *path_list)
@ -3761,7 +3761,7 @@ cygwin_posix_to_win32_path_list (const char *posix, char *win32)
CCP_POSIX_TO_WIN_A | CCP_RELATIVE)); CCP_POSIX_TO_WIN_A | CCP_RELATIVE));
} }
#endif /* !__x86_64__ */ #endif /* __i386__ */
extern "C" ssize_t extern "C" ssize_t
cygwin_conv_path_list (cygwin_conv_path_t what, const void *from, void *to, cygwin_conv_path_list (cygwin_conv_path_t what, const void *from, void *to,

View File

@ -1227,7 +1227,7 @@ acl32 (const char *path, int cmd, int nentries, aclent_t *aclbufp)
return res; return res;
} }
#ifndef __x86_64__ #ifdef __i386__
extern "C" int extern "C" int
lacl32 (const char *path, int cmd, int nentries, aclent_t *aclbufp) lacl32 (const char *path, int cmd, int nentries, aclent_t *aclbufp)
{ {
@ -1969,18 +1969,7 @@ aclfromtext32 (char *acltextp, int *aclcnt)
return (aclent_t *) __aclfromtext (acltextp, aclcnt, false); return (aclent_t *) __aclfromtext (acltextp, aclcnt, false);
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (acl32, acl)
EXPORT_ALIAS (facl32, facl)
EXPORT_ALIAS (aclcheck32, aclcheck)
EXPORT_ALIAS (aclsort32, aclsort)
EXPORT_ALIAS (acltomode32, acltomode)
EXPORT_ALIAS (aclfrommode32, aclfrommode)
EXPORT_ALIAS (acltopbits32, acltopbits)
EXPORT_ALIAS (aclfrompbits32, aclfrompbits)
EXPORT_ALIAS (acltotext32, acltotext)
EXPORT_ALIAS (aclfromtext32, aclfromtext)
#else
typedef struct __acl16 { typedef struct __acl16 {
int a_type; int a_type;
__uid16_t a_id; __uid16_t a_id;
@ -2066,4 +2055,15 @@ aclfromtext (char *acltextp, int *aclcnt)
{ {
return (__aclent16_t *) aclfromtext32 (acltextp, aclcnt); return (__aclent16_t *) aclfromtext32 (acltextp, aclcnt);
} }
#endif /* !__x86_64__ */ #else
EXPORT_ALIAS (acl32, acl)
EXPORT_ALIAS (facl32, facl)
EXPORT_ALIAS (aclcheck32, aclcheck)
EXPORT_ALIAS (aclsort32, aclsort)
EXPORT_ALIAS (acltomode32, acltomode)
EXPORT_ALIAS (aclfrommode32, aclfrommode)
EXPORT_ALIAS (acltopbits32, acltopbits)
EXPORT_ALIAS (aclfrompbits32, aclfrompbits)
EXPORT_ALIAS (acltotext32, acltotext)
EXPORT_ALIAS (aclfromtext32, aclfromtext)
#endif

View File

@ -44,7 +44,7 @@ void uinfo_init ();
#define MAP_UNIX_TO_CYGWIN_ID(id) (UNIX_POSIX_OFFSET \ #define MAP_UNIX_TO_CYGWIN_ID(id) (UNIX_POSIX_OFFSET \
| ((id) & UNIX_POSIX_MASK)) | ((id) & UNIX_POSIX_MASK))
#ifndef __x86_64__ #ifdef __i386__
#define ILLEGAL_UID16 ((__uid16_t)-1) #define ILLEGAL_UID16 ((__uid16_t)-1)
#define ILLEGAL_GID16 ((__gid16_t)-1) #define ILLEGAL_GID16 ((__gid16_t)-1)
#define uid16touid32(u16) ((u16)==ILLEGAL_UID16?ILLEGAL_UID:(uid_t)(u16)) #define uid16touid32(u16) ((u16)==ILLEGAL_UID16?ILLEGAL_UID:(uid_t)(u16))

View File

@ -1507,16 +1507,16 @@ lseek64 (int fd, off_t pos, int dir)
EXPORT_ALIAS (lseek64, _lseek64) EXPORT_ALIAS (lseek64, _lseek64)
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (lseek64, lseek)
EXPORT_ALIAS (lseek64, _lseek)
#else
extern "C" _off_t extern "C" _off_t
lseek (int fd, _off_t pos, int dir) lseek (int fd, _off_t pos, int dir)
{ {
return lseek64 (fd, (off_t) pos, dir); return lseek64 (fd, (off_t) pos, dir);
} }
EXPORT_ALIAS (lseek, _lseek) EXPORT_ALIAS (lseek, _lseek)
#else
EXPORT_ALIAS (lseek64, lseek)
EXPORT_ALIAS (lseek64, _lseek)
#endif #endif
@ -1623,15 +1623,15 @@ chown32 (const char * name, uid_t uid, gid_t gid)
return chown_worker (name, PC_SYM_FOLLOW, uid, gid); return chown_worker (name, PC_SYM_FOLLOW, uid, gid);
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (chown32, chown)
#else
extern "C" int extern "C" int
chown (const char * name, __uid16_t uid, __gid16_t gid) chown (const char * name, __uid16_t uid, __gid16_t gid)
{ {
return chown_worker (name, PC_SYM_FOLLOW, return chown_worker (name, PC_SYM_FOLLOW,
uid16touid32 (uid), gid16togid32 (gid)); uid16touid32 (uid), gid16togid32 (gid));
} }
#else
EXPORT_ALIAS (chown32, chown)
#endif #endif
extern "C" int extern "C" int
@ -1640,15 +1640,15 @@ lchown32 (const char * name, uid_t uid, gid_t gid)
return chown_worker (name, PC_SYM_NOFOLLOW, uid, gid); return chown_worker (name, PC_SYM_NOFOLLOW, uid, gid);
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (lchown32, lchown)
#else
extern "C" int extern "C" int
lchown (const char * name, __uid16_t uid, __gid16_t gid) lchown (const char * name, __uid16_t uid, __gid16_t gid)
{ {
return chown_worker (name, PC_SYM_NOFOLLOW, return chown_worker (name, PC_SYM_NOFOLLOW,
uid16touid32 (uid), gid16togid32 (gid)); uid16touid32 (uid), gid16togid32 (gid));
} }
#else
EXPORT_ALIAS (lchown32, lchown)
#endif #endif
extern "C" int extern "C" int
@ -1667,14 +1667,14 @@ fchown32 (int fd, uid_t uid, gid_t gid)
return res; return res;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (fchown32, fchown)
#else
extern "C" int extern "C" int
fchown (int fd, __uid16_t uid, __gid16_t gid) fchown (int fd, __uid16_t uid, __gid16_t gid)
{ {
return fchown32 (fd, uid16touid32 (uid), gid16togid32 (gid)); return fchown32 (fd, uid16touid32 (uid), gid16togid32 (gid));
} }
#else
EXPORT_ALIAS (fchown32, fchown)
#endif #endif
/* umask: POSIX 5.3.3.1 */ /* umask: POSIX 5.3.3.1 */
@ -1735,7 +1735,7 @@ fchmod (int fd, mode_t mode)
return cfd->fchmod (FILTERED_MODE (mode)); return cfd->fchmod (FILTERED_MODE (mode));
} }
#ifndef __x86_64__ #ifdef __i386__
static void static void
stat64_to_stat32 (struct stat *src, struct __stat32 *dst) stat64_to_stat32 (struct stat *src, struct __stat32 *dst)
{ {
@ -1839,10 +1839,7 @@ _fstat64_r (struct _reent *ptr, int fd, struct stat *buf)
return ret; return ret;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (fstat64, fstat)
EXPORT_ALIAS (_fstat64_r, _fstat_r)
#else
extern "C" int extern "C" int
fstat (int fd, struct stat *buf) fstat (int fd, struct stat *buf)
{ {
@ -1862,6 +1859,9 @@ _fstat_r (struct _reent *ptr, int fd, struct stat *buf)
ptr->_errno = get_errno (); ptr->_errno = get_errno ();
return ret; return ret;
} }
#else
EXPORT_ALIAS (fstat64, fstat)
EXPORT_ALIAS (_fstat64_r, _fstat_r)
#endif #endif
/* fsync: P96 6.6.1.1 */ /* fsync: P96 6.6.1.1 */
@ -1996,10 +1996,7 @@ _stat64_r (struct _reent *__restrict ptr, const char *__restrict name,
return ret; return ret;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (stat64, stat)
EXPORT_ALIAS (_stat64_r, _stat_r)
#else
extern "C" int extern "C" int
stat (const char *__restrict name, struct stat *__restrict buf) stat (const char *__restrict name, struct stat *__restrict buf)
{ {
@ -2020,6 +2017,9 @@ _stat_r (struct _reent *__restrict ptr, const char *__restrict name,
ptr->_errno = get_errno (); ptr->_errno = get_errno ();
return ret; return ret;
} }
#else
EXPORT_ALIAS (stat64, stat)
EXPORT_ALIAS (_stat64_r, _stat_r)
#endif #endif
/* lstat: Provided by SVR4 and 4.3+BSD, POSIX? */ /* lstat: Provided by SVR4 and 4.3+BSD, POSIX? */
@ -2032,9 +2032,7 @@ lstat64 (const char *__restrict name, struct stat *__restrict buf)
return stat_worker (pc, buf); return stat_worker (pc, buf);
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (lstat64, lstat)
#else
/* lstat: Provided by SVR4 and 4.3+BSD, POSIX? */ /* lstat: Provided by SVR4 and 4.3+BSD, POSIX? */
extern "C" int extern "C" int
lstat (const char *__restrict name, struct stat *__restrict buf) lstat (const char *__restrict name, struct stat *__restrict buf)
@ -2045,6 +2043,8 @@ lstat (const char *__restrict name, struct stat *__restrict buf)
stat64_to_stat32 (&buf64, (struct __stat32 *) buf); stat64_to_stat32 (&buf64, (struct __stat32 *) buf);
return ret; return ret;
} }
#else
EXPORT_ALIAS (lstat64, lstat)
#endif #endif
extern "C" int extern "C" int
@ -3023,15 +3023,15 @@ ftruncate64 (int fd, off_t length)
return res; return res;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (ftruncate64, ftruncate)
#else
/* ftruncate: P96 5.6.7.1 */ /* ftruncate: P96 5.6.7.1 */
extern "C" int extern "C" int
ftruncate (int fd, _off_t length) ftruncate (int fd, _off_t length)
{ {
return ftruncate64 (fd, (off_t)length); return ftruncate64 (fd, (off_t)length);
} }
#else
EXPORT_ALIAS (ftruncate64, ftruncate)
#endif #endif
/* truncate: Provided by SVR4 and 4.3+BSD. Not part of POSIX.1 or XPG3 */ /* truncate: Provided by SVR4 and 4.3+BSD. Not part of POSIX.1 or XPG3 */
@ -3053,15 +3053,15 @@ truncate64 (const char *pathname, off_t length)
return res; return res;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (truncate64, truncate)
#else
/* truncate: Provided by SVR4 and 4.3+BSD. Not part of POSIX.1 or XPG3 */ /* truncate: Provided by SVR4 and 4.3+BSD. Not part of POSIX.1 or XPG3 */
extern "C" int extern "C" int
truncate (const char *pathname, _off_t length) truncate (const char *pathname, _off_t length)
{ {
return truncate64 (pathname, (off_t)length); return truncate64 (pathname, (off_t)length);
} }
#else
EXPORT_ALIAS (truncate64, truncate)
#endif #endif
extern "C" long extern "C" long
@ -3548,14 +3548,14 @@ seteuid32 (uid_t uid)
return 0; return 0;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (seteuid32, seteuid)
#else
extern "C" int extern "C" int
seteuid (__uid16_t uid) seteuid (__uid16_t uid)
{ {
return seteuid32 (uid16touid32 (uid)); return seteuid32 (uid16touid32 (uid));
} }
#else
EXPORT_ALIAS (seteuid32, seteuid)
#endif #endif
/* setuid: POSIX 4.2.2.1 */ /* setuid: POSIX 4.2.2.1 */
@ -3573,14 +3573,14 @@ setuid32 (uid_t uid)
return ret; return ret;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (setuid32, setuid)
#else
extern "C" int extern "C" int
setuid (__uid16_t uid) setuid (__uid16_t uid)
{ {
return setuid32 (uid16touid32 (uid)); return setuid32 (uid16touid32 (uid));
} }
#else
EXPORT_ALIAS (setuid32, setuid)
#endif #endif
extern "C" int extern "C" int
@ -3602,14 +3602,14 @@ setreuid32 (uid_t ruid, uid_t euid)
return ret; return ret;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (setreuid32, setreuid)
#else
extern "C" int extern "C" int
setreuid (__uid16_t ruid, __uid16_t euid) setreuid (__uid16_t ruid, __uid16_t euid)
{ {
return setreuid32 (uid16touid32 (ruid), uid16touid32 (euid)); return setreuid32 (uid16touid32 (ruid), uid16touid32 (euid));
} }
#else
EXPORT_ALIAS (setreuid32, setreuid)
#endif #endif
/* setegid: from System V. */ /* setegid: from System V. */
@ -3662,14 +3662,14 @@ setegid32 (gid_t gid)
return 0; return 0;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (setegid32, setegid)
#else
extern "C" int extern "C" int
setegid (__gid16_t gid) setegid (__gid16_t gid)
{ {
return setegid32 (gid16togid32 (gid)); return setegid32 (gid16togid32 (gid));
} }
#else
EXPORT_ALIAS (setegid32, setegid)
#endif #endif
/* setgid: POSIX 4.2.2.1 */ /* setgid: POSIX 4.2.2.1 */
@ -3682,9 +3682,7 @@ setgid32 (gid_t gid)
return ret; return ret;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (setgid32, setgid)
#else
extern "C" int extern "C" int
setgid (__gid16_t gid) setgid (__gid16_t gid)
{ {
@ -3693,6 +3691,8 @@ setgid (__gid16_t gid)
cygheap->user.real_gid = myself->gid; cygheap->user.real_gid = myself->gid;
return ret; return ret;
} }
#else
EXPORT_ALIAS (setgid32, setgid)
#endif #endif
extern "C" int extern "C" int
@ -3714,14 +3714,14 @@ setregid32 (gid_t rgid, gid_t egid)
return ret; return ret;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (setregid32, setregid)
#else
extern "C" int extern "C" int
setregid (__gid16_t rgid, __gid16_t egid) setregid (__gid16_t rgid, __gid16_t egid)
{ {
return setregid32 (gid16togid32 (rgid), gid16togid32 (egid)); return setregid32 (gid16togid32 (rgid), gid16togid32 (egid));
} }
#else
EXPORT_ALIAS (setregid32, setregid)
#endif #endif
/* chroot: privileged Unix system call. */ /* chroot: privileged Unix system call. */

View File

@ -284,14 +284,14 @@ getuid32 (void)
return cygheap->user.real_uid; return cygheap->user.real_uid;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (getuid32, getuid)
#else
extern "C" __uid16_t extern "C" __uid16_t
getuid (void) getuid (void)
{ {
return cygheap->user.real_uid; return cygheap->user.real_uid;
} }
#else
EXPORT_ALIAS (getuid32, getuid)
#endif #endif
extern "C" gid_t extern "C" gid_t
@ -300,14 +300,14 @@ getgid32 (void)
return cygheap->user.real_gid; return cygheap->user.real_gid;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (getgid32, getgid)
#else
extern "C" __gid16_t extern "C" __gid16_t
getgid (void) getgid (void)
{ {
return cygheap->user.real_gid; return cygheap->user.real_gid;
} }
#else
EXPORT_ALIAS (getgid32, getgid)
#endif #endif
extern "C" uid_t extern "C" uid_t
@ -316,14 +316,14 @@ geteuid32 (void)
return myself->uid; return myself->uid;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (geteuid32, geteuid)
#else
extern "C" uid_t extern "C" uid_t
geteuid (void) geteuid (void)
{ {
return myself->uid; return myself->uid;
} }
#else
EXPORT_ALIAS (geteuid32, geteuid)
#endif #endif
extern "C" gid_t extern "C" gid_t
@ -332,14 +332,14 @@ getegid32 (void)
return myself->gid; return myself->gid;
} }
#ifdef __x86_64__ #ifdef __i386__
EXPORT_ALIAS (getegid32, getegid)
#else
extern "C" __gid16_t extern "C" __gid16_t
getegid (void) getegid (void)
{ {
return myself->gid; return myself->gid;
} }
#else
EXPORT_ALIAS (getegid32, getegid)
#endif #endif
/* Not quite right - cuserid can change, getlogin can't */ /* Not quite right - cuserid can change, getlogin can't */

View File

@ -160,10 +160,10 @@ extern "C" PVOID dll_dllcrt0 (HMODULE, per_process *);
extern "C" void _pei386_runtime_relocator (per_process *); extern "C" void _pei386_runtime_relocator (per_process *);
#ifndef __x86_64__ #ifdef __i386__
/* dynamically loaded dll initialization for non-cygwin apps */ /* dynamically loaded dll initialization for non-cygwin apps */
extern "C" int dll_noncygwin_dllcrt0 (HMODULE, per_process *); extern "C" int dll_noncygwin_dllcrt0 (HMODULE, per_process *);
#endif /* !__x86_64__ */ #endif /* __i386__ */
void __reg1 do_exit (int) __attribute__ ((noreturn)); void __reg1 do_exit (int) __attribute__ ((noreturn));