Commit Graph

48 Commits

Author SHA1 Message Date
0261d12727 Remove some checks for usupported VS versions (<2013).
This was SVN commit r16225.
2015-01-24 20:37:16 +00:00
0d23e3f333 post-alpha sync with work.
debug stack trace fixes, remove more asm, change CONTINUE/OK scheme to
OK/ALL_COMPLETE, fix tests

This was SVN commit r9871.
2011-07-18 09:21:56 +00:00
5c76bc12fa refactor status code definitions: allow modules to define an array of them (more convenient+efficient).
merge ERR::NO_SYS, NOT_IMPLEMENTED into NOT_SUPPORTED
renderer: remove unnecessary ogl_shader include

This was SVN commit r9447.
2011-05-05 13:03:34 +00:00
cccd6849a7 cleanup (requires update-workspaces)
lib_errors.cpp: replace with status.cpp, adapt to needs at work
wutil: fix runtime warning reported via feedback box
config: merge CONFIG_PARANOIA and !CONFIG_FINAL into
CONFIG_ENABLE_CHECKS
add openmp, pointer_typedefs.h

This was SVN commit r9410.
2011-05-03 12:38:42 +00:00
4663ac0fe7 split debug_assert into ENSURE and ASSERT as discussed in a previous meeting.
the old debug_assert always ran and tested the expression, which slows
down release builds. wrapping them in #ifndef NDEBUG is clumsy. the new
ASSERT behaves like assert and ENSURE like the old debug_assert. Let's
change any time-critical but not-super-important ENSURE to ASSERT to
speed up release builds. (already done in bits.h and unique_range.h)

This was SVN commit r9362.
2011-04-30 13:01:45 +00:00
9193ba56f9 Build fixes and whatnot
This was SVN commit r9115.
2011-03-23 21:15:22 +00:00
1f7e8d7194 per discussion with Philip, remove STL_HASH_MAP etc. because they're ugly, rarely used and superseded by boost::unordered*
This was SVN commit r9111.
2011-03-23 16:56:27 +00:00
1861448e6c needed to split lib into separate headers and source files, which requires lots of drudgery to specify paths for each include filename (no longer relying on same-directory lookups)
also rename wchar -> utf8 to avoid conflict with <wchar.h> (requires
rebuild of workspace)
(unfortunately copying history fails to "502 bad gateway"; had to delete
old + add new independently)

This was SVN commit r7340.
2010-03-01 14:52:58 +00:00
c2fd939898 license change to the more permissible Expat/MIT license for lib/ (see forum thread)
This was SVN commit r7316.
2010-02-08 16:23:39 +00:00
03726c0b54 ICC build fixes
warning fixes
get rid of SAFE_WCSCPY and SAFE_STRCPY

This was SVN commit r7239.
2010-01-01 15:33:07 +00:00
607ea6f8b4 chip away at gcc errors/warnings
This was SVN commit r7172.
2009-11-06 16:15:09 +00:00
8a52113e60 huge cleanup and conversion of most string handling (especially paths) to unicode
please note: format strings must be %hs for char* arguments and %ls for
wchar_t*

This was SVN commit r7161.
2009-11-03 21:46:35 +00:00
df36e937f0 Patch from #258: [FreeBSD compat] add some missing includes
This was SVN commit r7001.
2009-07-16 16:53:55 +00:00
1743645fd3 Simplify the overly-complex CppDoc-breaking file headers
This was SVN commit r6832.
2009-04-18 17:51:05 +00:00
214b0e6683 Removed outdated licensing information
This was SVN commit r6831.
2009-04-18 17:17:34 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
aea2368300 fixes to stack trace code under x64 (from work):
- displaying symbol values requires stack pointer, not frame pointer
- update debug_IsPointerBogus
- skip-n-frames code changed to skip-all-frames-up-to-func (more
reliable in the face of inlining)

debug.cpp: cleanup

This was SVN commit r6410.
2008-09-27 10:05:11 +00:00
a3fb9051b6 Fix MSVC build errors and warnings
This was SVN commit r6254.
2008-07-19 00:58:34 +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
c0ed950657 had to remove uint and ulong from lib/types.h due to conflict with other library.
this snowballed into a massive search+destroy of the hodgepodge of
mostly equivalent types we had in use (int, uint, unsigned, unsigned
int, i32, u32, ulong, uintN).

it is more efficient to use 64-bit types in 64-bit mode, so the
preferred default is size_t (for anything remotely resembling a size or
index). tile coordinates are ssize_t to allow more efficient conversion
to/from floating point. flags are int because we almost never need more
than 15 distinct bits, bit test/set is not slower and int is fastest to
type. finally, some data that is pretty much directly passed to OpenGL
is now typed accordingly.

after several hours, the code now requires fewer casts and less
guesswork.

other changes:
- unit and player IDs now have an "invalid id" constant in the
respective class to avoid casting and -1
- fix some endian/64-bit bugs in the map (un)packing. added a
convenience function to write/read a size_t.
- ia32: change CPUID interface to allow passing in ecx (required for
cache topology detection, which I need at work). remove some unneeded
functions from asm, replace with intrinsics where possible.

This was SVN commit r5942.
2008-05-11 18:48:32 +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
74b4ac19c1 cleanup+fixes; wdbg_heap is now feature complete.
should be safe to distribute this build

code_annotation.h: add our own noncopyable to avoid DLL base class
warning
debug: remove some unicode functions (unnecessary); minor cleanup
debug_stl: disabled
mahaf: do not warn when running as non admin
wdbg: add wdbg_printf and wdbg_assert for use in allocation hook. add
header
wdbg_heap: now feature complete.
. allows storing 3..4 frames from the call stack with 0 space overhead.
. prevents garbage file/line output.
. takes care of allocation counting (previously done by profiler)
wdbg_sym.cpp: cleanup+fixes (locking, wdbg_*)

fix: properly specify __declspec(dllimport) for certain classes

This was SVN commit r5679.
2008-02-25 21:19:52 +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
46dd72de18 # Fixed STL debug compile errors on GCC.
This was SVN commit r5406.
2007-10-11 07:55:24 +00:00
0841404218 fix debug_stl for vc8; refactor/simplified implementation
This was SVN commit r5396.
2007-10-09 17:05:05 +00:00
bc519cc671 prevent crash if lib_error association code is called before _cinit (happens if there's a problem with whrt init).
instead of std::map, use a linked list of static LibErrorAssociation
instances. (also simplifies the process of registering error
codes/descriptions)

module_init: remove warning (happens in normal operation)
win: add fixed InterlockedExchangePointer definition
mahaf: no longer warn if stopping the service failed because it wasn't
started

This was SVN commit r5104.
2007-05-28 09:20:55 +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
0bb0df5b2c # new year's cleanup (reduce dependencies, clean up headers)
- remove headers always included from PCH
- nommgr.h is only included ifdef REDEFINED_NEW (allows leaving out the
mmgr stuff)
- in lib/*.cpp, moved the corresponding include file to right behind the
PCH (catches headers that aren't compilable by themselves)
- byte_order no longer depends on SDL
- add debug_level (another means of filtering debug output; needed for
thesis)
- split posix stuff up into subdirs (lib/posix and sysdep/win/wposix).
makes including only some of the modules (e.g. sockets, time) much
easier.

This was SVN commit r4728.
2007-01-01 21:25:47 +00:00
de0f893c18 Recompiled Premake on Windows. Added some headers so HAVE_PCH=0 works in MSVC.
This was SVN commit r4442.
2006-09-30 21:36:19 +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
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
b8c131c431 # housekeeping
* zip.h removed old test symbols
* path_util fixed bug in mixed-separating-slash handling
* renamed ERR_OK to INFO_OK; allows searching for "return ERR_" to yield
all actual errors (instead of having to filter out ERR_OK)

This was SVN commit r3945.
2006-06-04 22:27:40 +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
c81df59294 # Include headers for compilation without PCH
This was SVN commit r3774.
2006-04-19 05:30:02 +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
b37d3f2095 # fix W4 warnings on VC
This was SVN commit r3726.
2006-04-03 22:06:09 +00:00
1c1200a049 - massive overhaul of lib error code returning. int -> LibError everywhere.
- add translators from errno and GetLastError to LibError
- clarified return values of callbacks (they must return
INFO_CB_CONTINUE to continue)
- this exposed a few bugs in error handling chains (returning incorrect
values); also reduced say-nothing instances of return -1.
- move CHECK_ERR etc. macros to lib_error

This was SVN commit r3229.
2005-12-11 22:23:55 +00:00
622ceeda94 - color -> colour
- add note on performance in TextureManager.cpp

debug_stl: more fine-grained #if STL_DINKUMWARE (gets this closer to
working on other STL implementations)
vfs.h: improved dox and moved vfs_path public functions here.
cursor: pass g_mouse_x as a parameter (SwEng)

This was SVN commit r2595.
2005-08-10 01:12:03 +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
b3a9ed2886 New terrain properties stuff, gcc compatability and updated unix debugging stuff
This was SVN commit r2581.
2005-08-07 21:58:36 +00:00
3eb916ee1a share set and map impl
add further test cases and fixed the ensuing problems.

This was SVN commit r2465.
2005-07-04 00:50:53 +00:00
cc6abc389a - debug_stl: revert to char* for all program symbols (helpful due to preprocessor limitation)
- add stdext and new STL containers to stl_simplify_name
- fix internal error when container is uninitialized (now check cntr
fields directly instead of calling e.g. size(), which can crash)
- all container wrappers now have a consistent interface, no more
specialization needed in iterator
- fix potential loophole with container adapters
- refactor dump_sequence

This was SVN commit r2464.
2005-07-03 22:36:24 +00:00
ad98213c39 config - fix problem with stl version detect, cleanup
debug - documented
debug_stl - WIP; large changes because specialized containers were
breaking in some cases. now have to do it "right" ;p
add SLIST container and MULTISET

This was SVN commit r2461.
2005-07-03 20:47:24 +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
a1e149ab11 more of the asserts.. also:
- increase stack trace buffer size (needed for some complicated nested
expressions)
- fix bug in container output - no longer treat iterator (i.e.
x::iterator) as an x string (now uses match_wildcard instead of simple
string compare)
- add unicode match_wildcard
- bugfix for vectored exception handler - was always ignoring exceptions
from main thread (fixed the previous fix where it was always grabbing
all exceptions ;p)
- better array display (display less of huge arrays)
- fix nesting limit (which was too low); make sure infinite
nesting/indirection can't happen

This was SVN commit r2448.
2005-06-28 04:12:50 +00:00
1367825d47 config: detect STL version
debug_stl: commented, improved validation functions and #ifdef-ed
STL-version-specific code
wdbg: prevent vectored exception handler from preempting __try (by

This was SVN commit r2443.
2005-06-27 00:25:10 +00:00
c4bf180bfc add support for displaying values in stl containers; also moved stl_simplify_name here.
win.cpp: fix WinXP dependency

This was SVN commit r2438.
2005-06-25 07:54:15 +00:00