summaryrefslogtreecommitdiff
path: root/nasmlib/file.h
Commit message (Collapse)AuthorAgeFilesLines
* disam: explicitly change stdin to binary modeChang S. Bae2020-04-221-0/+22
| | | | | | | | | | | | | | | | | | | The binary mode has no difference from text mode in POSIX-compliant operating systems. The two modes are distinguishable from each other on Windows, and perhaps on other systems as well. The binary stream has scalability and other advantages. Windows treats the standard input stream as text mode by default. So the code changes it to binary mode. Also, add a helper function, nasm_set_binary_mode(), that is OS-agnostic, in the library. Reported-by: Didier Stevens <didier.stevens@gmail.com> Suggested-by: Didier Stevens <didier.stevens@gmail.com> Link: https://bugzilla.nasm.us/show_bug.cgi?id=3392649 Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
* file.c: handle long pathnames on WindowsH. Peter Anvin (Intel)2019-05-151-41/+126
| | | | | | | | | | Windows supports pathnames up to 32767 UTF-16 characters, but using the standard interfaces only up to 260 characters. Wrap the functions that take filenames on Windows. Clean up the compatiblity layers some more for reduced #ifdefs. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* Remove #includes already provided by "compiler.h"H. Peter Anvin2018-12-271-1/+0
| | | | | | | | "compiler.h" already includes a bunch of common include files. There is absolutely no reason to duplicate them in individual files, and in fact it robs us of central control of how these files are used. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Windows: clean up the handling of stat on WindowsH. Peter Anvin2017-04-061-22/+47
| | | | | | | | [f]stat on Windows is messy: we need to use _stati64 for maximum compatibility, but because there is a bunch of stuff wrapped in macros, autoconf sometimes gets the wrong answers. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* MSVC compatibility: clean up the handling of _stati64/_fstati64H. Peter Anvin2017-04-051-6/+7
| | | | | | | | | | | On Windows we need to use _stati64/_fstati64 in order to handle large file sizes, but the handling was broken in the canned MSVC++ configuration. Clean it up and fix it. This addresses BR 3392398. Reported-by: Nikolai Saoukh <nms@otdel-1.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* asm/*: Move directive processing to its own file, refactor error handlingH. Peter Anvin2017-03-071-0/+1
| | | | | | | | Move directive processing to its own file, and move nasmlib/error.c to asm/error.c (it was not used by the disassembler); remove some extern declarations from .c files, and do some general code cleanups. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* nasmlib/file: move memory-mapping functions out of file.cH. Peter Anvin2017-02-231-0/+101
Move memory-mapping functions from file.c into a separate mmap.c. This will be cleaner especially once (if) we end up doing a Windows implementation, which is likely to look entirely different. Signed-off-by: H. Peter Anvin <hpa@zytor.com>