Jeff Johnston [Fri, 24 Apr 2009 22:52:52 +0000 (22:52 +0000)]
2009-04-24 Jeff johnston <jjohnstn@redhat.com>
* libc/stdio/fgetc.c: Make sure sfp lock is acquired before the
file lock and released before the file lock to avoid a deadlock
scenario.
* libc/stdio/fgets.c: Ditto.
* libc/stdio/fgetwc.c: Ditto.
* libc/stdio/fgetws.c: Ditto.
* libc/stdio/fread.c: Ditto.
* libc/stdio/fseek.c: Ditto.
* libc/stdio/getc.c: Ditto.
* libc/stdio/getdelim.c: Ditto.
* libc/stdio/gets.c: Ditto.
Jeff Johnston [Fri, 24 Apr 2009 22:49:55 +0000 (22:49 +0000)]
2009-04-24 Jeff johnston <jjohnstn@redhat.com>
* configure.in: Add configuration test for long double equals dbl
and set flag _LDBL_EQ_DBL if true.
* configure: Regenerated.
* newlib.hin: Add _LDBL_EQ_DBL flag.
* libc/include/math.h: Use _LDBL_EQ_DBL flag instead of
_HAVE_LDBL_MATH.
* libc/include/stdlib.h: Use _LDBL_EQ_DBL flag instead of
_HAVE_LDBL_STDLIB.
* libc/common/local.h: Remove _LDBL_EQ_DBL flag setting.
* libc/stdlib/local.h: Ditto.
Eric Blake [Fri, 24 Apr 2009 12:20:07 +0000 (12:20 +0000)]
Trigger gcc warning if isFoo macros are called with plain char.
* libc/include/ctype.h (isalpha, isupper, islower, isdigit)
(isxdigit, isspace, ispunct, isalnum, isprint, isgraph)
(iscntrl, isblank, toupper, tolower): Rewrite to let 'gcc -Wall'
warn when user calls macro with a char argument.
Jeff Johnston [Thu, 23 Apr 2009 17:54:22 +0000 (17:54 +0000)]
2009-04-23 Paul Brook <paul@codesourcery.com>
Kazu Hirata <kazu@codesourcery.com>
* libc/stdlib/__atexit.c (__register_exitproc): Use weak reference
to malloc. Allocate dynamically only if it is present.
* libc/stdlib/__call_atexit.c (__call_exitprocs): Use weak
reference to free. Call free only if it is present.
* libc/ctype/ctype_.c (_CTYPE_DATA_128_255): Rename from
_CTYPE_DATA_128_256.
* libc/ctype/ctype_cp.h: Split off all character class values for
character 255 from the rest of the definitions.
(__ctype_cp): Use the new definitions. Make sure that the table
always contains 0 for EOF (-1).
* libc/ctype/ctype_iso.h: Ditto.
Jeff Johnston [Mon, 20 Apr 2009 18:06:14 +0000 (18:06 +0000)]
2009-04-20 Jeff johnston <jjohnstn@redhat.com>
* libc/include/math.h: Change _LDBL_EQ_DBL flag usage to
be _HAVE_LDBL_MATH.
* libc/include/stdlib.h: Change _LDBL_EQ_DBL flag usage to
be _HAVE_LDBL_STDLIB.
* flock.cc (lf_setlock): Handle border case which results in WFMO loop
exiting with ret == WAIT_TIMEOUT gracefully. Add a system_printf to
uncover other potential problems with WFMO loop.
* flock.cc (class inode_t): Add i_wait member and matching methods
wait(), unwait(), and waiting().
(inode_t::inode_t): Initialize i_wait to 0.
(fhandler_disk_file::lock): Only remove node if no other thread is
waiting for a blocking lock.
(lf_setlock): Manipulate node->i_wait to signal that a thread is
waiting for a blocking lock in this node.
(lf_findoverlap): Reinstantiate SELF test as in original code.
* dlfcn.cc (get_full_path_of_dll): Just return a bool value. Drop
local path_conv in favor of getting it as parameter. Add local string
buffer instead of getting it as parameter.
(dlopen): Accommodate get_full_path_of_dll change. Fetch WCHAR Windows
path from path_conv variable and call LoadLibraryW.
* path.cc (path_conv::get_wide_win32_path): Allow relative paths.
(cygwin_conv_path): In case of CCP_POSIX_TO_WIN_W, convert relative
paths to absolute paths if the relative pathname length exceeds
MAX_PATH.
* mkimport: New script to perform all operations necessary to create
libcygwin.a.
* rmsym: Delete.
* newsym: Delete.
* Makefile.in (toolopts): New variable which holds options relating to
binutils/gcc tools.
(speclib): Use toolopts. Add symbols to avoid copying to special libraries.
(OBSOLETE_FUNCTIONS): Delete.
(NEW_FUNCTIONS): Change to represent an argument to new mkimport script.
(libcygwin.a): Use only new mkimport script to create libcygwin.a. Only rely
on ${LIBCOS}.
(*/lib*.a): Simplify speclib dependencies.
(speclib): Accept toolchain options. Convert every argument to absolute path.
Simplify parsing of nm output. Accommodate new exclude option.
Chris Sutcliffe [Sat, 11 Apr 2009 12:41:09 +0000 (12:41 +0000)]
2009-04-11 Danny Smith <dannsymith@users.sourceforge.net>
* include/stdint.h (int_fast8_t): Specify as signed char.
(INT8_C, UINT8_C, INT16_C, UINT16_C): Simplify: just allow promotion to int.
(INT32_C, UINT32_C): Remove 'L' type specifier on constant.
* speclib: Semi-revert to previous version but don't try to generate
well-formed import library. Instead, just extract appropriate symbols and let
later libcygwin.a on link line fill in the rest of the import stuff.
* gendef: Hopefully no-op modification to allow easier post-processing on
symbol values.
* libc/ctype/ctype_.c (_CTYPE_DATA_0_127): Remove _B flag from TAB.
* libc/ctype/ctype_cp.h: Mark non-cased letters in tables for codepages
720, 862, 874, 1255, and 1256 to _U|_L. Fix a couple of incorrect
class mappings.
* libc/ctype/ctype_iso.h: Mark non-cased letters in ISO-8859 tables
6, 8, and 11 to _U|_L. Fix a couple of incorrect class mappings.
* libc/ctype/isblank.c (isblank): Special case TAB.
* libc/ctype/islower.c (islower): Check explicitely for _L flag only
in (_U|_L).
* libc/ctype/isupper.c (isupper): Ditto, but check for _U flag.
* libc/include/ctype.h (islower): Same in macro.
(isupper): Ditto.
(isblank): Special case TAB. Redefine macro for GCC only.
* fhandler_disk_file.cc (fhandler_disk_file::fchown): Catch an
error when changing the user account on a standalone Samba server.
Explain why.
* sec_acl.cc (setacl): Accommodate additional parameter to set_file_sd.
* sec_helper.cc (SECURITY_SAMBA_UNIX_AUTHORITY): Define.
(well_known_samba_unix_user_fake_sid): Define.
* security.cc (set_file_sd): Take additional parameter if ownership
should be changed. Restrict requested permissions accordingly.
(set_file_attribute): Accommodate additional parameter to set_file_sd.
* security.h (well_known_samba_unix_user_fake_sid): Declare.
(set_file_sd): Align declaration to above change.
* libc/stdlib/mbctype.h (_iseucjp1): Like _iseucjp, but also
recognizes 0x8e and 0x8f lead bytes.
(_iseucjp2): Rename from _iseucjp.
* libc/stdlib/mbtowc_r.c (__eucjp_mbtowc): Convert JIS-X-0212
triplebyte sequences as well.
* libc/stdlib/wctomb_r.c (__eucjp_wctomb): Convert to JIS-X-0212
triplebyte sequences as well.
* strfuncs.cc: Change WCHAR to wchar_t in multibyte<->widechar
conversion functions throughout.
* wchar.h: Ditto in declarations. Guard them __INSIDE_CYGWIN__.
* setup2.sgml (setup-locale-console): New section to explain
console character set setting.
* faq: Throughout, change references to User's Guide to references
to 1.7 User's Guide temporarily.
* faq-setup.html (faq.using.unicode): Rephrase slightly.
(faq.using.weirdchars): New FAQ entry for console charset problems.
* fhandler.h (class dev_console): Add members con_mbtowc, con_wctomb,
and con_charset.
(dev_console::str_to_con): Take mbtowc function pointer and charset
as additional parameters.
* fhandler_console.cc (fhandler_console::get_tty_stuff): Initialize
aforementioned new members. Explain why.
(dev_console::con_to_str): Remove useless comment. Call new
sys_cp_wcstombs function rather than sys_wcstombs.
(dev_console::str_to_con): Take mbtowc function pointer and charset
as additional parameters. Call sys_cp_mbstowcs accordingly.
(fhandler_console::write_normal): Only initialize f_mbtowc and charset
once. Accommodate changed str_to_con.
* strfuncs.cc (sys_cp_wcstombs): Renamed from sys_wcstombs. Take
wctomb function pointer and charset as parameters. Use throughout.
(sys_cp_mbstowcs): Take wctomb function pointer and charset as
parameters instead of codepage. Remove matching local variables and
their initialization.
* wchar.h (ENCODING_LEN): Define as in newlib.
(__mbtowc): Use mbtowc_p typedef for declaration.
(wctomb_f): New type.
(wctomb_p): New type.
(__wctomb): Declare.
(__utf8_wctomb): Use wctomb_f typedef for declaration.
(sys_cp_wcstombs): Move declaration from winsup.h here.
(sys_wcstombs): Ditto.
(sys_wcstombs_alloc): Ditto.
(sys_cp_mbstowcs): Ditto.
(sys_mbstowcs): Ditto.
(sys_mbstowcs_alloc): Ditto.
* winsup.h: Move declaration of sys_FOO functions to wchar.h. Include
wchar.h instead.
* strfuncs.cc: Add comment to explain why we can't support JIS
for now.
(__db_wctomb): Alwaus use WC_NO_BEST_FIT_CHARS.
(__jis_wctomb): Just call __ascii_wctomb from here.
(__eucjp_wctomb): Convert to standalone implementation to fix up the
difference between eucJP and CP 20932 affecting JIS-X-0212 characters.
Explain.
(__kr_wctomb): Use codepage 949.
(__db_mbtowc): Reorder code slightly. Always use MB_ERR_INVALID_CHARS
in call to MultiByteToWideChar. Fix a problem with singlebyte
sequences. Fix a bug in '\0' handling. Reset state->__count on
successful return from non-zero state.
(__jis_mbtowc): Just call __ascii_mbtowc from here.
(__eucjp_mbtowc): Convert to standalone implementation to fix up the
difference between eucJP and CP 20932 affecting JIS-X-0212 characters.
(__kr_mbtowc): Use codepage 949.
(__set_charset_from_codepage): Handle codepage 20932 as eucJP.
* net.cc: Undefine NOERROR and DELETE to avoid compiler warnings.
* shared_info.h (CURR_SHARED_MAGIC): Update.
* spawn.cc (spawn_guts): Avoid copying one line command line argument if it
hasn't been filled out.
* include/asm/byteorder.h (__ntohl): Prototype before define to avoid
a warning with -Wmissing-prototypes. Use _ELIDABLE_INLINE macro from
_ansi.h.
(__ntohs): Ditto.