Commit Graph

65 Commits

Author SHA1 Message Date
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
60f48f558d # infrastructure improvements
make off_t pointer-sized (required for >4gb files at work)
add shared_ptr deleter for free(), add ASSUME_ALIGNED, warning fixes

This was SVN commit r6826.
2009-04-18 08:41:10 +00:00
16ccae10cd # fix warnings
more icc11 fixes - mostly type conversion and noncopyable (now made a
macro)

This was SVN commit r6536.
2008-12-17 16:32:46 +00:00
f7d5711623 additions from work:
add shared_ptr wrapper for numa_allocator and page_aligned_alloc
(removing previous code from shared_ptr.cpp)
pch: add TR1 array
wposix: add setenv
wtime: add strptime

This was SVN commit r6486.
2008-11-20 16:35:30 +00:00
4132549c2c 64-bit fixes (the parts of lib/ in use at work are now fully operational in 64-bit mode)
- x86_x64.cpp: fix: test ARCH_AMD64 instead of ARCH_IA32 because both
are defined on x64
- manifest.cpp: fix processor architecture
- wdbg_heap.cpp: only enable on ia32
- winit, wstartup: take (lack of) name mangling into account

compiler.h: add STRINGIZE and DECORATED_NAME for use by winit
dir_watch: fix: smart pointers were never actually released due to a
remaining reference

This was SVN commit r6375.
2008-09-16 17:46:45 +00:00
a3b7e8c08c needed unicode at work:
debug: reinstate wchar_t version of debug_printf
  file, waio: add hack to allow creating File_Posix with unicode path
wposix: no longer include some rarely-used stuff to avoid conflict with
3rd party libraries
precompiled: bring boost::bind into global namespace (present in TR1)

dir_watch: needed directory watching with unicode paths and larger
buffers at work, so I completely overhauled and documented this

timer: add ToSeconds

SocketBase: fix to ensure correct match despite ::bind's conflict with
boost::bind

This was SVN commit r6319.
2008-08-09 19:22:13 +00:00
fbc3d22720 Use GCC's std::tr1::unordered_* classes instead of the now-deprecated __gnu_cxx::hash_* when possible
This was SVN commit r6250.
2008-07-19 00:20:54 +00:00
5d80d2ee5d fixes+improvements from work:
- add AlignedAllocator - an STL allocator that returns
cache-line-aligned objects (required to avoid RFOs when threads write to
various independent items in a container)
- bits: bit_mask can now be used for N=0..numBits (works around
full-word-shifts-are-undefined issue)
- precompiled.h: remove scoped_ptr, add function-related stuff from TR1
- numa:
  . add numa_IsMemoryInterleaved
  . numa_Allocate is now able to allocate large pages as well (reduces
TLB misses)
- os_cpu: interface change to support 32-bit apps running on WoW64
systems with > 4 GB of memory
- topology: use new x86_x64_EnumerateCaches API; fix detection of cache
ID
- x86_x64: provide the means of enumerating all caches returned by CPUID
and detect L1 cache size

This was SVN commit r6004.
2008-06-01 08:25:12 +00:00
04127c7af3 fixes/improvements to lib code from work
- topology.cpp: modify interface due to thread-safety issue. caller is
now responsible for ensuring the first _Detect call isn't reentered;
everything else is safe.
- fix thread-safety issue in wnuma; use winit mechanism to ensure it's
ready before use
- VFS now takes a cacheSize parameter (required for being able to
disable read-only file caches for the image loader at work)
- allow dynarray that isn't actually holding memory
- debug_stl: VC9 fix (disable this code except on the exact STL version
on which it was tested)
- zlib, lib_api: changes to macro used to toggle between static and
dynamic linking
- add boost filesystem header in external_libraries
- amd64: cpu_ topology functions are now provided by x86_x64
- cpu: remove cpu_ClockFrequency (dangerous, may be tempting to use
during WHRT init which would cause a crash). use x86_x64_ClockFrequency
or os_cpu_ClockFrequency instead.
- werrno: cope with newer boost versions
- wmman: follow SUSv3 in rejecting zero-length mappings

This was SVN commit r5954.
2008-05-13 19:43:02 +00:00
cc243f67eb fixes/improvements made at work:
- fix lots of 64-bit warnings
- round_up/down now templates
- avoid warning with definition of byte swap functions; remove
duplication of that in wsdl
- codec_zlib.cpp: avoid domination warning
- vfs/file_cache: VFS is now responsible for handling zero-length files
(no longer considered an error; just returns zero pointer and size=0)
- cpu: export all functions (thus obviating cpu_memcpy_thunk). this
required renaming asm functions and adding thunk functions that call
them
- winit: fix segment merge statement, reinstate /include (otherwise init
functions are stripped by linker)
- wstartup: VC CRT init section definitions have changed in amd64 build;
match their definition
- wsysdep.cpp: more descriptive text for osError = 0

This was SVN commit r5899.
2008-05-01 15:41:42 +00:00
a915bdc1b6 fix problems related to 64-bit compilation in lib
. dbghelp is now pulled in by a separate external_libraries header
. disable _SECURE_SCL (improves perf)
. amd64: initial implementation of essential functions, not yet complete
. manifest: disabled on ICC because its IPO module incorrectly
interprets /manifestdependency
. wdbg_sym: no longer support stack walks on non-ia32 win2k (avoids
trouble due to mixing SEH and dtors)
. winit and wstartup: had to remove forced symbol include - does not
link otherwise on ICC (for reasons unknown). function pointers are
actually included and called on x64 windows (compiling with MSC)

This was SVN commit r5895.
2008-04-19 18:10:00 +00:00
9269be9ee3 remove mmgr and macros that redefine malloc/new/free
(see http://www.wildfiregames.com/forum/index.php?showtopic=11450&hl= )

clean up debug module
. no longer include platform-dependent header (-> less rebuilds)
. DISPLAY_ERROR -> DEBUG_DISPLAY_ERROR
. parts of config.h that don't affect all files moved to config.2 (->
fewer full rebuilds)
. remove creaky symbol cache (no longer needed for mmgr)
. remove TLS thread naming stuff (can use debugger's thread window
instead; no need for platform independence there)

wdbg: remove thread suspension and breakpoint APIs (not needed)

acpi: fix: u64 -> uintptr_t

wutil: fix WinScopedLock, use that instead of direct lock() functions

misc:
. get rid of SAFE_STRCPY, replace with strcpy_s
. remove _getcwd (shouldn't be used)

This was SVN commit r5563.
2008-01-19 11:33:11 +00:00
2c2a394a1e Fixed allocators.h reference. Fixed repeated warning in GCC.
This was SVN commit r5535.
2008-01-07 02:06:27 +00:00
2e5d9452aa part2: misc source/lib fixes/improvements
move all except user-specified config choices out of config.h and into
appropriate headers
CPU_IA32 -> ARCH_IA32
wsdl: disable use of ddraw (will soon be replaced by WMI)

use shared_ptr without namespace qualifier (it's in tr1)
debug_warn -> debug_assert(0)
LIB_API to allow building as DLL
smart pointers: reduce use of .get()
cache_adt: use map instead of hash_map (avoids needing a hashCompare
class). also remove spurious warning
code_annotation.h: better cassert implementation
move FPS measuring portion of timer.cpp into frequency_filter
move include of memory headers into mmgr.h (to avoid errors, we must
ensure they are included if mmgr is used)
posix_filesystem.h: move definition of mkdir to wfilesystem
stl: disable iterator checks in release mode
wmi: fix COM init bug, use smart pointers
wutil: add code to get DLL module handle (if compiled as such), add
WinScopedLock
timer: fix handling of raw ticks

This was SVN commit r5517.
2007-12-20 20:09:19 +00:00
d19a2cba65 include boost smart pointers from PCH
factor out the "atom_fn" mechanism into lib/allocators/string_pool.cpp
factor out FAT date/time handling into lib/fat_time.cpp
path_util: replace strcpy with SAFE_STRCPY; add additional functions
that avoid passing an output buffer via StringPool

This was SVN commit r5474.
2007-11-20 18:44:36 +00:00
80057a82e5 patch, gameview: fix typos, revise according to coding convention
improve CPU brand string detection
wposix: no more ONCE during init (not thread-safe). also remove
redundant round_up
fold string_s into secure_crt

vfs: small fixes+commenting improvements while calling VFS back into
memory

This was SVN commit r5054.
2007-05-10 20:47:17 +00:00
a34b759720 . split up lib.h/.cpp, include the remnants from PCH, remove (pretty much universal) include of it.
. timer, config: fix definition of ALLOW_RDTSC
. add movsx_be64 (for whirlpool), revise implementation, move to
byte_order, add test
. MAX -> std::max, remove those macros
. add timestamp to system_info as requested by philip

This was SVN commit r5050.
2007-05-09 21:01:11 +00:00
b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +00:00
be3f3bdbfb # SwEng / MacOSX compat
further cleanup to sysdep.h: avoid pulling in win and ia32; split header
up into stl, compiler, and the actual sys_* API. (all but the latter are
in PCH).

timer: also avoid dragging in ia32
win: move snprintf fix to posix.h
cpu: simplify reasoning about cores, now given as logicalPerCore (not
package)
vfs_optimizer: fix if archive building is partially disabled

This was SVN commit r5008.
2007-04-30 14:35:19 +00:00
c2b119e721 # Linux fixes.
Disabled CONFIG_USE_MMGR by default, since it seems unnecessary and it
makes debug builds slow (extremely slow under Valgrind) due to symbol
lookups when allocating memory.
Fixed minor warnings and errors.

This was SVN commit r4927.
2007-02-25 21:11:57 +00:00
27b6ffe2d6 # housekeeping
sorry, update-workspaces + rebuild is necessary (moved boost/utility
into PCH)

- ps/ : committed additional documentation on behalf of Joe.
- lib/ : HAVE_C99 - replace with specific e.g. HAVE_NPRINTF; intended to
help with MacOSX compat (by no longer requiring us to lie about
STDC_VERSION)
- NO_COPY_CTOR -> boost::noncopyable

This was SVN commit r4825.
2007-02-01 01:34:17 +00:00
871cdb6ef9 # SwEng (reduce full recompiles by splitting up master error header)
- error codes now accessed as ERR::NO_MEM, INFO::OK etc.
- no more X-macros => the above are now recognized by visual assist
- error codes are defined by the module originating them (lib_errors has
some generic ones)
  => no full rebuild when adding some
- error descriptions are now in C++ files => can be changed without full
rebuild

added AT_STARTUP in lib.h.

This was SVN commit r4374.
2006-09-22 13:19:40 +00:00
8e02ec84f9 Updated OpenAL to 1.1 (which no longer includes ALUT).
Changed player-id code a bit so the entity and actor and unit should
stay in sync more often. (The entity/actor/unit mixing still looks a bit
dodgy and unreliable, though.)
Simplified console help code.
Allowed init/shutdown to be done with the simulation/world/etc parts
disabled (so the actor viewer can load faster).

This was SVN commit r4289.
2006-09-02 21:20:25 +00:00
802e099e35 # mac compat
tricky issue with isfinite: <cmath> also stomps on that (C99) macro,
instead of only C89 libc. fix: include math.h instead. rationale is
documented.

This was SVN commit r4224.
2006-08-12 16:42:50 +00:00
aeed96dafa # improvements to build system for asm files
split ia32_asm code up into memcpy, color
premake: add (windows-only so far) support for NASM include paths -
required when using %include. see rationale in vs.c
refs #124

This was SVN commit r4039.
2006-06-25 20:58:03 +00:00
ee4c7965dd # merge all local changes; moving over to new SVN server
* app_hooks: add display_error; can be used by atlas to override our
dialog box
* lots of small fixes (mostly pertaining to headers)
* debug: clean up display_error, protect from reentrancy, fix a few edge
cases (e.g. error message from dtor -> exit pressed -> suppress all
subsequent errors)
* delay_load: add warning: NLSO ctors are unreliable since we're
compiling into static lib

This was SVN commit r4009.
2006-06-22 18:26:08 +00:00
9542ecdd7e # boatload of fixes to get self-tests to compile+mostly run
refs #117

stub_impl_hack: defines a function otherwise provided by main.cpp

remove old self_test.h contents (e.g. TEST); superceded by cxxtestgen
TS_ASSERT etc.
only include self_test from a test (otherwise, cxxtest include dir won't
be set)
cxxtest won't run tests named only "test"; add more descriptive name

FIXES uncovered by self tests
lib: infinite loop in log2
lockfree: incorrect params

This was SVN commit r3979.
2006-06-08 19:03:43 +00:00
5814e10126 # complete revamp of build system in preparation for automated self tests.
* now splits everything up into independent static libraries.
* fixed a great deal of incorrect #include statements. all headers must
now be specified with their full path relative to source. exception: if
file being included and including file are in the same directory, no
path needed.
use <> when relying on the build system's include path (e.g. for system
headers and external libraries, e.g. boost), otherwise "".

* temporarily renamed maths/Vector2D to Vector2D_Maths to avoid
conflict. these should be merged.
* hacked around VC linker stupidness when building static libs; texture
codecs must now be registered manually.

This was SVN commit r3931.
2006-06-02 03:56:24 +00:00
5f7855f7f0 Simplification of #Include paths: relative names are used only for included files in the same directory as the including file; everything else uses the full path relative to source/.
This was SVN commit r3930.
2006-06-02 02:10:27 +00:00
9124f7266c Tidied up some include paths
This was SVN commit r3929.
2006-06-02 01:01:39 +00:00
3d26549032 Fixed file properties - removed svn:executable and svn:keywords (left over from CVS conversion?) from all files; set svn:eol-style=native for *.cpp, *.h (and fixed files with inconsistent line endings)
This was SVN commit r3802.
2006-04-23 23:14:18 +00:00
836cd08d5e # add CppDoc file header to all files, along with their descriptions.
also:
- renamed wdll to delay_load, and wdll_ver to dll_ver
- removed empty wcpu

This was SVN commit r3751.
2006-04-11 23:59:08 +00:00
987a6b7d4e fixed wchar_t issues; now correctly separates utf16, CStrW and jschar.
NOTE: wchar_t should be defined as a built-in type; no more need to
define manually or change project settings.

adts: disambiguate iterator type; add operator- as required by VC8
std::equal() implementation
precompiled: squelch stupid warning (that informs us that array members
are now actually default-initialized as called for by C++)
file_cache: remove debug variable

This was SVN commit r3464.
2006-02-03 20:36:15 +00:00
1227cb2f6d adts: add RingBuf self-test. RingBuf: make entry#0 the 'head' and pop_front a no-op if empty.
allocators: allow pool_create at NLSO ctor time
lib: add rand() function based on libc rand and self-test. (this allows
easily returning a random number within a range, and avoids a number of
pitfalls - the naive rand()%range approach is baaad)
precompiled: add self_test.h, so that self tests won't be accidentally
disabled by forgetting to include the header

file_cache: add self-test; fixed 2 bugs that exposed (was incorrectly
splitting large blocks and not setting class_size bit properly). fix
weird corner case in BlockMgr (attempting to free LRU block but it is
locked).

file_io, wdbg_sym: tiny fixes

This was SVN commit r3461.
2006-02-03 04:02:53 +00:00
7c6bac667c Apparently, there's a conflict between setjmp.h and libpng in some cases.
So don't always include setjmp.h

This was SVN commit r3440.
2006-01-29 19:46:31 +00:00
fcfa746244 Linux compat changes, fix for (really old) bug in VertexBufferManager shutdown, GUI header reorganization for gcc 4.0
This was SVN commit r3437.
2006-01-29 18:23:47 +00:00
a0a01e7a7d Linux/GCC Compat, added some includes, ported inline assembly stuff to gnu syntax (and misc. cleanup in ia32.cpp)
This was SVN commit r2702.
2005-09-12 23:37:52 +00:00
5f1983b9a4 Avoid "unreachable code" warnings
This was SVN commit r2618.
2005-08-14 02:07:12 +00:00
5299dcad86 - config: all macros are defined as 1 / 0. testing with #if allows compiler warnings (testing undefined macro) to spot misspelled macros
- debug: add provision for naming threads. allows adding current thread
name to log messages and displays their names in the debugger.
- replaced various if(err < 0) complain() sequences with new variants of
CHECK_ERR (see lib.h)
- fixes to mmgr/VC debug alloc enable code
- improved h_mgr error reporting (now complains when h_free fails)
- US -> UK english (partial)
- fix tex_load double-free bug
- move win32 mouse cursor code into sysdep
- error dialog is now topmost to make sure it's visible (was a problem)
- handle WM_QUIT before displaying error dialog (makes sure it's shown)

also as in previous 3 revisions.

This was SVN commit r2588.
2005-08-09 16:23:19 +00:00
580d0c7892 Everything-except-for-VS2005 fix: disable warning disabling to avoid warnings
This was SVN commit r2456.
2005-07-03 00:50:49 +00:00
2ea40a23a3 VS2005 compatibility fixes and warning adjustments:
Updated DLLs.
Added DirectX headers/libraries, since they're not in the platform SDK.
Fixed invalid STL iterator usage.
Disabled STL in stack trace, since it breaks.
Added comments for some reported warnings.
Corrected some apparent off-by-one errors.
Defined strlen_s to strnlen.
Probably broke pre-beta2 versions of VC2005.

This was SVN commit r2454.
2005-07-02 21:42:55 +00:00
85a8d217de config: add endian detect
byte_order: use config.h defines (avoids pulling in sdl.h everywhere)
precompiled: now include *all* C++ headers

This was SVN commit r2436.
2005-06-25 07:43:13 +00:00
8f9a3fc38f - config.h: massive improvements, much clearer.
- tentatively activate PCH if gcc > 3.4. remove XP_ defines (which were
undocumented; now in scripting/spidermonkey.h)
- rename some config defines
- move sysdep/debug.h to lib/debug.h (it's portable; was wrong all
along)
- grouped all debug heap related stuff to debug.h:debug_heap_*
- sysdep: fix circular include issue with debug.h

This was SVN commit r2427.
2005-06-22 03:23:22 +00:00
b657a1cbca Added CStr and some other things to precompiled.h, to reduce build times.
Altered CStr/UniDoubler's macros, to avoid polluting/conflicting/etc.
Fixed headers in non-PCH builds.
Used the _d version of vorbisfile*.lib in Debug builds.

This was SVN commit r2366.
2005-06-01 20:12:45 +00:00
ffd141c1e3 remove no longer necessary include guard define (it used to work around a mmgr and crtdbg conflict, but that has since been fixed)
This was SVN commit r2013.
2005-03-18 22:26:49 +00:00
35540e806e This was SVN commit r1955. 2005-02-28 15:50:35 +00:00
da5816e971 Re-enabled VC's memory debugging by default (when not using USE_MMGR). Hopefully fixed the resulting memory leaks. Also fixed incompatibilities with VC2005.
This was SVN commit r1950.
2005-02-27 22:11:26 +00:00
157f77887c types.h => lib/types.h (avoid name collision)
This was SVN commit r1937.
2005-02-26 15:15:36 +00:00
28602d600d mmgr ported to linux
This was SVN commit r1895.
2005-02-02 17:01:33 +00:00
7cb28a242c win_internal: removed contents of crtdbg and malloc.h (no longer needed, since precompiled.h now correctly includes the mem trackers and all memory-related system headers)
precompiled: restructured, documented everything, memory system headers
are now included before mmgr.h to prevent conflicts (before, had
#defined include guard of crtdbg.h and malloc.h and manually declared
their contents - a hack)

This was SVN commit r1885.
2005-01-30 23:09:51 +00:00