From 79e56091c9e4f21ecf1807e0f0f4441ddddc84e6 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 22 Feb 2001 12:56:36 +0000 Subject: * shortcut.c: New file. Provides a C interface to reading of Windows shortcuts to avoid compiler flag `-fvtable-thunks'. * shortcut.h: Ditto. * Makefile.in: Add shortcut.o to DLL_OFILES. * cygerrno.h: Provide a C interface to `geterrno_from_win_error' for using in shortcut.c. * errno.cc (geterrno_from_win_error): Define as extern "C". * path.cc (struct symlink_info): Remove methods `check_shortcut' and `check_sysfile'. (shortcut_header): Move to shortcut.c. (shortcut_initalized): Ditto. (create_shortcut_header): Ditto. (cmp_shortcut_header): Ditto. (symlink_info::check_shortcut): Ditto. Reorganize as a plain C function. (symlink_info::check_sysfile): Redefine as a global function using the same parameter list as `check_shortcut' for clearness. (symlink_info::check): Change parameter list for calls to `check_shortcut' and `check_sysfile'. --- winsup/cygwin/cygerrno.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/cygerrno.h') diff --git a/winsup/cygwin/cygerrno.h b/winsup/cygwin/cygerrno.h index dd40819b9..ad2fad7a1 100644 --- a/winsup/cygwin/cygerrno.h +++ b/winsup/cygwin/cygerrno.h @@ -8,9 +8,20 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ +#ifdef __cplusplus +extern "C" { +#endif + +int __stdcall geterrno_from_win_error (DWORD code, int deferrno) __attribute__ ((regparm(2))); + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus + void __stdcall seterrno_from_win_error (const char *file, int line, DWORD code) __attribute__ ((regparm(3))); void __stdcall seterrno (const char *, int line) __attribute__ ((regparm(2))); -int __stdcall geterrno_from_win_error (DWORD code, int deferrno) __attribute__ ((regparm(2))); #define __seterrno() seterrno (__FILE__, __LINE__) #define __seterrno_from_win_error(val) seterrno_from_win_error (__FILE__, __LINE__, val) @@ -32,3 +43,5 @@ class save_errno extern const char *__sp_fn; extern int __sp_ln; + +#endif /* __cplusplus */ -- cgit v1.2.3