Commit Graph

48 Commits (64715c592f6d45dc88c623446db20c1c5f6ee205)

Author SHA1 Message Date
Giel van Schijndel 37c6b31651 * When using a va_list multiple times make sure to va_copy it first
* Because va_copy is C99 provide a fallback for it on non-C99 systems (which assumes that va_list is just a pointer to the stack)

This fixes ticket:50, thanks to Buginator for finding the cause (though this solution is different from his suggestion)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5930 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-05 19:38:22 +00:00
Giel van Schijndel 5e593ad615 Add platform detection code for GNU/kFreeBSD (OS with FreeBSD kernel and GNU utilities and libraries) to allow compiling on this system
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5794 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-11 15:29:44 +00:00
Roman C b40f5dd5a3 Get rid of some more compiler warnings on MSVC.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5032 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 10:17:49 +00:00
Roman C 2c7d52d0c8 Fix MSVC compilation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4914 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 12:55:05 +00:00
Per Inge Mathisen 221a2cb4ee Remove MSVC support for WZ_DECL_CONST since it didn't work.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4913 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 12:34:20 +00:00
Per Inge Mathisen 6e9732a86a WZ_DECL_CONST now implies WZ_DECL_WARN_UNUSED_RESULT and also works on MSVC.
WZ_DECL_RESTRICT now works on MSVC as well.
WZ_DECL_THREAD added, declares variables thread local, support for it made mandatory.
WZ_ASSERT_STATIC_STRING (gcc only) to assert that a string is static added.
The sstr functions now support pointer-length strings again.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4908 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 11:43:28 +00:00
Roman C c3ace2ec9f Redefine __STDC__ to 1, this fixes MSVC compilation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4855 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 15:05:08 +00:00
Giel van Schijndel b047f2c1ef Work around MSVC not #defining __STDC__ (all ISO C89 compliant compiles _should_ #define that macro)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4854 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 14:32:14 +00:00
Giel van Schijndel c6a0ad011e restrict is not a keyword to C++, so don't use it when compiling as C++
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4615 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-14 21:39:14 +00:00
Per Inge Mathisen b41b7358b7 Add safer, proven versions of strlcpy and strlcat from OpenBSD.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4483 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 11:45:29 +00:00
Giel van Schijndel 57389641e7 Remove the last content of deliverance.h (#define MAX_STR_LENGTH 256) to wzglobal.h and remove it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4219 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-21 23:02:22 +00:00
Dennis Schridde 9ca4445189 We always only have either config.h or config-macosx.h, but not both.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4207 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-21 16:38:57 +00:00
Dennis Schridde 303895e5fb Mark all BASE_OBJECT "derived" types as WZ_DECL_MAY_ALIAS (they may alias with any type).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4011 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-11 15:53:45 +00:00
Per Inge Mathisen 916435094f Add message to MSVC users about disabled warnings. Patch #995 from Buginator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3967 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-09 10:06:05 +00:00
Dennis Schridde 056147b16d Oh my beauty...
Please don't clutter the detection code with platform specific fixes... That's what the /* ---- Platform specific setup ---- */ section is for...


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3948 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 21:51:53 +00:00
Per Inge Mathisen dfad738d65 Fix most MSVC warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3947 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 19:26:19 +00:00
Per Inge Mathisen b4ef4d4349 Add new function attribute WZ_DECL_WARN_UNUSED_RETURN and use it on IdToDroid,
whose return must be checked, and fix one bug already detected by it.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3260 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-30 21:44:14 +00:00
Dennis Schridde 248a8cb510 Minor indent
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3170 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-24 22:05:15 +00:00
Giel van Schijndel 798d10c6d8 * Guarantee that PATH_MAX is large enough to use as the size for Windows API calls (since with MinGW it is 159 bytes while it should be 160)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3136 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-23 16:44:36 +00:00
Giel van Schijndel 7711572f0a * Add a new module (printf_ext.c) to contain some printf extensions (C99 printf variants for MSVC)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2803 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-11 20:58:10 +00:00
Giel van Schijndel a08e6f07f8 * Provide alloca() on GCC, MinGW and MSVC (and all other WZ_OS_UNIX compilers that provide <alloca.h>
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2801 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-11 20:04:50 +00:00
Dennis Schridde 1dd2b54431 wzglobal.h never belonged to Eidos. Instead large parts of the code are copied from Qt and thus belong to Trolltech.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2776 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-10 13:25:02 +00:00
Dennis Schridde 5ccaa17971 Correct WZ_CC_TINYC check. (Note the namechange!)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2775 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-10 12:10:54 +00:00
Dennis Schridde 3a56a479b3 - Extend compiler detection with TinyCC
- Add window system detection
- Remove MSDOS from supported OSes


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2771 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-10 00:31:43 +00:00
Giel van Schijndel 96d5054729 * Make sure to #include <stdio.h> when compiling on MSVC so that those inline replacements for snprintf and vsnprintf will actually compile....
* Lets terminate statements with a semi-colon!!


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2745 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-06 18:36:37 +00:00
Giel van Schijndel 7b2530306c * On MSVC make sure to #define inline __before__ using it!!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2744 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-06 18:30:19 +00:00
Giel van Schijndel 92e013e406 * Add static inline functions vsnprintf and snprintf when compiling with MSVC
* These functions comply to the C99 specification and return the amount of characters they would have written if no truncation occurred
Slightly modified form of patch file #3146 attached to bug #10269 by Buginator; applied the changes of this patch to wzglobal.h instead of version.c


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2742 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-06 14:07:50 +00:00
Per Inge Mathisen 1811aa0cdb Use secure version of snprintf on Windows (_snprintf_s).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2638 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 15:50:45 +00:00
Dennis Schridde c7b00fadaf More work on the ICC front:
- Less strict warnings in debug-mode (still unusable, because ICC warns about _a lot_)
- Explicit conversions
- Clarify parameter evaluation order


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2550 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-15 18:09:18 +00:00
Dennis Schridde 274abd14ca Fix WZ_DECL_FORMAT for non >=gcc-2.5
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2430 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-22 18:04:07 +00:00
Dennis Schridde 63a38d0da9 Include unistd.h for MinGW as well.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2428 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 14:52:50 +00:00
Dennis Schridde fbd3a9c394 Use Unix PATH_MAX as default and thus move all "fixes" to Windows.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2425 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 12:59:05 +00:00
Dennis Schridde 08a43494fd - Clean up macros a bit more
- Use WZ_CC_GNU_PREREQ (copied from glibc's features.h) instead of custom code
- Move platform.h into wzglobal.h


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2424 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 12:30:00 +00:00
Dennis Schridde 3d6d40f5dd - Update WZ_OS_/WZ_CC_ definitions from Qt 4.3.1 and don't strip OS detection them anymore.
- Fix attribute prerequisites.
- Remove wz__attribute and add WZ_DECL_FORMAT.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2423 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 11:21:20 +00:00
Dennis Schridde 51a467d649 Remove CHAR_BIT check which is not needed anymore.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2422 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 10:43:16 +00:00
Giel van Schijndel 12f21d0b0c * Replace usage of uint8_t with char for C-strings; while (u)int8_t works perfectly nice for numbers it isn't nice for text (char-array)
* To make sure we still have the guarantee that a char is 8bit I've inserted a static assertion for this (CHAR_BIT == 8)
 * Use exact length types for lobbyserver

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1821 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 12:01:59 +00:00
Dennis Schridde 58e8bda3a9 _ISOC99_SOURCE is a libc macro, we now use WZ_C99 instead (which gets defined via __STDC_VERSION__)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1749 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-29 14:55:24 +00:00
Dennis Schridde 2313b8d53e The Vector3 functions where not really const, since they operated on pointers.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1706 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 17:00:55 +00:00
Dennis Schridde 52486bee8b const const const
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1702 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-25 17:21:13 +00:00
Ari Johnson e0872c90af WZ_OS_MAC now no longer unsets WZ_OS_UNIX due to compatability update in
r1638.  Exception handler still removed if WZ_OS_MAC is set.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1640 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-15 20:33:55 +00:00
Ari Johnson 1ed4ff54e8 Mac OS X related improvements:
- WZ_OS_MAC && DEBUG implies --debug all so that Console.app can be used
   to view debugging output on debug builds when launching from Finder
 - DEBUG flag re-added to Debug builds in Xcode project; was removed
   accidentally at some point
 - WZ_OS_MAC no longer implies WZ_OS_UNIX; handled separately where
   necessary
 - Do not use Warzone's crash handler since Mac OS X provides a good
   crash reporter already that just saves the crash log, with lots of
   useful information, to ~/Library/Logs/CrashReporter/Warzone.crash.log


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1635 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-14 21:48:20 +00:00
Dennis Schridde 7ee7276d89 Hacky fix for wrong POSIX checks. Now all non-Windows systems are treated as POSIX systems and required to support the Single UNIX specs Version 2.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1591 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-06 16:26:09 +00:00
Ari Johnson 91535c6596 Converted MacOS port to use Xcode to produce a universal binary. Warzone
will henceforth require MacOS 10.4 "Tiger" to run.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1492 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 03:10:53 +00:00
Dennis Schridde 62341e6aa4 - New macro: WZ_OS_POSIX (if _XOPEN_SOURCE >= 500)
- Added a bit more safety to WZ_DECL_UNUSED (not sure since which GCC version this exists, so choose >=3.2)
- Encapsulate GLibC extensions and use rest of errorHandler for all POSIX systems (thus renamed to posixErrorHandler)
- A little bit more verbosity in the gdmp


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1222 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-10 19:43:02 +00:00
Per Inge Mathisen bbc588699d Turn __attribute__((unused)) into WZ_DECL_UNUSED, which is unset
for compilers other than gcc. Thanks to devurandom for bringing 
this problem to my attention. Also update documentation for
WZ_DECL_DEPRECATED, which had bitrotted. 


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1149 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 17:46:06 +00:00
Dennis Schridde 49ceba7503 Add GPL notices to all sourcecode files.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1014 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-15 20:09:25 +00:00
Stefan Huehner 532ada3156 Add doxygen style headers to .h files to document
their meaning.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@759 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-25 16:46:28 +00:00
Dennis Schridde 3261a09baf BIG cleanup of headers.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@749 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-23 17:24:55 +00:00