summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/syscalls.cc
Commit message (Collapse)AuthorAgeFilesLines
* Avoid conflict with libraries' HAVE_*Neil Moore2014-07-121-2/+2
|
* Drop double newlines where they seem to serve no purpose.Adam Borowski2013-12-211-2/+0
| | | | | Sometimes, they're there to emphasize a break between two sections of code, which is good. In a majority of cases, though, they're just inconsistent.
* More formatting fixes for return (...);Neil Moore2013-11-151-6/+6
|
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-2/+2
|
* Don't include MSVC dirent emulation.Adam Borowski2013-07-021-5/+5
| | | | | | | | We don't actually use it. Two of contribs, pcre and sdl, reference it from their autoconfage, so I'm not sure if it's optional or mandatory, and can't check myself -- not deleting it yet. In any case, even a cursory look shows at least two bugs, but I can't think of a case we could call this code, even not directly.
* Add a few #includes to avoid missing-declaration warnings.Neil Moore2013-04-071-0/+1
|
* Use std namespace.Raphael Langella2012-08-261-7/+7
| | | | | | | | | | | | | I had to rename distance() (in coord.h) to distance2() because it conflicts with the STL function to compare 2 iterators. Not a bad change given how it returns the square of the distance anyway. I also had to rename the message global variable (in message.cc) to buffer. I tried to fix and improve the coding style has much as I could, but I probably missed a few given how huge and tedious it is. I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool and util/levcomp.*, because I have no clue about those.
* Do a compile check for the presence of fdatasync().Adam Borowski2012-07-141-6/+11
| | | | | | | | | | This is a NIH implementation of a part of autoconf, it is limited as it would be hard to affect the Makefile from such tests. On the other hand, even nasty hacks like grepping for sqlite features are not enough here, as we're looking for something in system headers. I think all of configuration in the Makefile should be nuked and rewritten, so it's just a crutch for 0.11.
* Implement mkstemp() for Windows.Adam Borowski2012-07-111-0/+24
| | | | | | | I used this function because some random page misled me into thinking it is available on Windows (possibly a fault of my poor reading comprehension...). It looks like that there's no existing function on Windows that's race-free, so I implemented one from scratch.
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-3/+3
|
* Make a bunch of functions static, delete some unused junk.Adam Borowski2011-11-111-9/+0
|
* Fix possible data loss on OS X.Adam Borowski2011-08-091-1/+5
| | | | | | I'm not sure if the things I read are still true -- Sqlite folks analyzed fsync() problems in OSX 10.3, they might have been fixed since; but it never hurts to try the other way after the fcntl failed.
* alarm() for Windows.Adam Borowski2011-06-091-0/+11
|
* Put usleep() emulation into syscalls.ccAdam Borowski2011-06-041-0/+31
|
* Use a Mac-specific fcntl() instead of fsync() which is buggy there.Adam Borowski2011-05-241-0/+8
| | | | | | | | | | | The same can happen on old systems written in days when disks did not have internal caches yet, and on some disks which lie about flushes to score higher in benchmarks. While the former is understandable and the latter has been mostly eradicated due to outrage, there is no excuse for this behaviour of fsync() when a working version exists. So yeah, we need to use fcntl(fd, F_FULLFSYNC, 0) since this is how real fsync() is named there.
* Hide output charset conversions behind a macro.Adam Borowski2011-04-181-20/+19
| | | | | | They're not that interesting and cloud code readability. What humans care about is the conversion of Crawl's internal format to native strings (OUTS) or native wide strings (OUTW, Windows only).
* Merge branch 'unicode'.Adam Borowski2011-04-011-9/+147
|\ | | | | | | | | There are some issues left, like incorrect wrapping in some cases, but we can fix them later.
| * Merge branch 'master' into unicodeAdam Borowski2011-01-111-0/+40
| |\ | | | | | | | | | Conflicts galore...
| * \ Merge branch 'master' into unicodeAdam Borowski2010-12-121-0/+49
| |\ \
| * \ \ Merge branch 'master' into unicodeAdam Borowski2010-12-021-2/+29
| |\ \ \
| * | | | Handle filenames with non-ascii characters.Adam Borowski2010-09-171-7/+146
| | | | | | | | | | | | | | | | | | | | | | | | | Only iostreams functions are left; on Windows they don't support Unicode so a workaround will be needed.
* | | | | Make file headers doxygen-friendly, drop useless fields.Adam Borowski2011-03-281-5/+4
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | "File:" is shown in your editor's status bar. "Written by:" was used only for the first person who changed a file. We got git for that now, and pre-DCSS history is so woefully inaccurate it doesn't really matter.
* | | | Use the Windows equivalent of /dev/urandom there.Adam Borowski2010-12-311-0/+41
| |_|/ |/| | | | | | | | | | | | | | | | | Without it, starting Crawl twice in the same second produced identical seeds. It doesn't matter for real games (no DGL on Windows...), but can be surprising when doing automated tests or playing with layout generators.
* | | Cowardly assume that systems lack fdatasync() unless on a list.Adam Borowski2010-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | It's strange that FreeBSD and old MacOS X don't have something that was mandated in POSIX Issue 5 (1997), but let's cope with that. It's better to unfairly accuse other systems of noncompliance and suffer a slowdown than to fail to build at all.
* | | A comment about fdatasync() on new fruits.Adam Borowski2010-12-041-1/+3
| | |
* | | fdatasync() implementation for Mac OS XMatthew Tadd2010-12-041-0/+7
| | |
* | | Add an implementation of fsync() for Windows.Adam Borowski2010-12-031-0/+40
| |/ |/|
* | Implement file locking on Windows.Adam Borowski2010-12-021-2/+29
|/
* Fix the save browser on non-Windows.Adam Borowski2010-09-061-2/+2
|
* Use file locking on the save file to prevent corruption from running Crawl ↵Adam Borowski2010-09-061-0/+32
twice. This fixes Mantis 2061. I did not reuse the existing lk_open() because it's non-portable, waits for the lock to become available and works using FILE* not a descriptor (bad for random access).