Commit Graph

135 Commits

Author SHA1 Message Date
Angen
d33f1c7321 Remove not needed checks and code for VS2015 [VS2013 -> VS2015]
Some pragma warnings are not more needed for VS2015 compilation this
removes them.
Removing some specific code for older version than VS2015.
Forcing build to fail if compiling with VS older than VS2015.

Differential Revision: https://code.wildfiregames.com/D1396
Reviewed by: @Itms
This was SVN commit r23416.
2020-01-19 12:43:41 +00:00
cc67d54aeb Fix compiler warnings on VS 2015, refs #3439, refs #5069.
Patch By: Stan
Reviewed By: Itms, vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1262
This was SVN commit r21480.
2018-03-10 09:58:53 +00:00
43137fef3f Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c).
Differential Revision: https://code.wildfiregames.com/D716
Refs 09e974e1cb
Reviewed By: bb
Change in agreement with leper.

This was SVN commit r19899.
2017-07-10 14:26:24 +00:00
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
ef2a358f87 Remove sys_vswprintf.
The implementation on Windows was gross. The only user was CLogger,
which no longer uses it.

Also fix vswprintf_s to handle truncated output correctly (by returning
"") on Linux, now that CLogger is no longer relying on the buggy
behaviour.

This was SVN commit r16190.
2015-01-22 20:39:28 +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
9193ba56f9 Build fixes and whatnot
This was SVN commit r9115.
2011-03-23 21:15:22 +00:00
0999ba0941 refactoring:
- simplify sys_get_executable_name interface - return OsPath directly,
rename to sys_ExecutablePathname
- add validation of path components in GetDirectoryEntries
- replace multiple calls to GetModuleFileNameW with
sys_ExecutablePathname
- lift nearly all MAX_PATH limitations (required at work)

This was SVN commit r9109.
2011-03-23 16:14:47 +00:00
64a02932e3 refactor headers: path_util -> path, native_path -> os_path, remove where unnecessary
This was SVN commit r9108.
2011-03-23 14:43:35 +00:00
dcd192cb60 refactor path interface:
- use wrapper class instead of std::wstring (reduces mixing of
strings/paths; allows safe+easy join via operator/ and convenient
case-insensitive comparison via operator==, avoids NativePathFromString,
similar to boost::filesystem)
- NativePath -> OsPath
- add hash and To/FromJSVal for Path
- add TS_ASSERT_PATH_EQUALS
- replace _wfopen_s with sys_OpenFile
- remove obsolete SortFiles/Directories

This was SVN commit r9107.
2011-03-23 13:36:20 +00:00
6d25329412 # towards locale-independent pathnames on Linux
c.f.
http://www.wildfiregames.com/forum/index.php?showtopic=14541&st=0&p=217250&#entry217250
and 2011-03-19 meeting

This was SVN commit r9090.
2011-03-21 17:53:13 +00:00
a0a245d0ec sync with work. add u8_from_larger, sys_IsDebuggerPresent, wdll_main.h;
robustify waio file mode and remove a safety check (since
OVERLAPPED.Internal is documented to be subject to change)

This was SVN commit r9050.
2011-03-11 16:29:27 +00:00
9bbda8b80b HTTP proxy discovery for Windows
This was SVN commit r8969.
2011-02-21 21:54:47 +00:00
002e3f5606 minor fixes from work; also add sys_WideFromArgv
This was SVN commit r8856.
2011-01-04 19:53:38 +00:00
ba2a9d7af3 improvements from work: [update-workspaces required]
- split precompiled.h into several headers (simplifies reuse)
- enable additional warnings not in W4
- split ErrorReaction into ErrorReactionInternal - clarifies which
values can actually be returned by debug_DisplayError
- wsdl: slightly safer HDC usage via CS_OWNDC, avoid dipping into DC
cache via ValidateRect instead of BeginPaint; remove unused thread
create
- StdDeserializer - wasn't including byte_order => BYTE_ORDER was
undefined
- wsysdep: clean up error dialog message handling

This was SVN commit r8828.
2010-12-09 11:16:21 +00:00
1706363bab Fix #423 (Switch from CppDoc to Doxygen), based on patch from anr.
Also delete some unused declarations, and rename is_playing to
snd_is_playing.

This was SVN commit r7813.
2010-07-29 15:55:41 +00:00
4b06ebd52d Add basic help page into the main menu.
Add buttons to open the web site and IRC.
Tentatively allow Atlas to be launched from the menu.
Add some shutdown functions to support relaunching into Atlas without
having to restart the whole process.

This was SVN commit r7714.
2010-07-07 21:47:31 +00:00
20c50d32d4 Windows fixes.
Avoid Boost.Random since it adds a dependency on a new library.

This was SVN commit r7654.
2010-06-30 23:40:51 +00:00
545979040b Expose the user's login name.
This was SVN commit r7648.
2010-06-30 21:18:29 +00:00
dba377532e # low-level fixes and improvements
dbghelp: ensure the DLL from our executable directory is loaded (avoids
breakage related to search-path and Dropbox)
wmi: use single-thread apartment COM model because multithreaded breaks
SHGetFolderPathW
wsysdep: sys_pick_directory: allow user-specified initial path; fix
previous non-unicode initial path; avoid reporting error if user cancels
wutil: add function to query executable directory at any time

This was SVN commit r7633.
2010-06-23 16:17:25 +00:00
6fb5c1b307 lib/ changes required at work:
- allow building regardless of UNICODE setting (e.g. use LoadLibraryW
instead of LoadLibrary)
- export dlopen etc.
- more robust redirection of stdout

This was SVN commit r7427.
2010-04-03 10:46:28 +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
97db62c944 fix handling of non-CP1252 characters in paths
(added wide-character versions of posix opendir etc. - on Windows, we
must not convert to UTF8)

This was SVN commit r7243.
2010-01-05 19:44:30 +00:00
3334c83ce0 Fix build and tests on Linux
This was SVN commit r7174.
2009-11-06 18:35:32 +00:00
048d4c41c8 fix: unix doesn't have a standard wopen(). we'd like to use wchar_t _wopen on Windows, and convert to UTF8+open() on unix, which calls for adding a new sys_wopen() interface to sysdep.
This was SVN commit r7173.
2009-11-06 16:46:08 +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
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
c4654fd8fa bits: avoid sign conversion warning
debug: cleanup
ogl_tex, tex: use full-width types to avoid truncation warnings
wdbg_sym.cpp: skip __suppress and __profile symbols; add additional hex
display for floats; cleanup
wdll_ver.cpp: cppdoc+cleanup (remove non-reentrant C interface, replace
with std::string)
sysdep: add cppdoc

everything else: flag parameters are now consistently size_t instead of
int (avoids warnings, allows slightly better code on x64)

This was SVN commit r6392.
2008-09-18 11:27:55 +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
56bd5b59b4 sysdep cleanup:
- factor cursor and clipboard out of sysdep.h
- remove empty sysdep.cpp
- wcpu: remove profiler code (it's in wprofiler.cpp if we ever need it)
- robustify clipboard code
- wsysdep: move code to determine app window into wutil; it's now used
by the clipboard code

This was SVN commit r5364.
2007-09-23 10:15:28 +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
4be0fe18a0 # SwEng
. major compat fixes for interoperation with wxw.
. add crashlog_sender (modified version of debgrpt wxw sample). compiles
but untested, will be changed heavily
further improvements:
. wposix no longer declares CRT functions. instead, use CRT headers..
but don't allow their (incorrect/non-POSIX) declarations to propagate to
users.
. split up win.cpp into wstartup, wutil, winit
. extern "C" -> EXTERN_C
. move sdl.* to lib/external_libraries and add png.h+zlib.h (fixes for
and include of the library)

This was SVN commit r5028.
2007-05-04 17:30:32 +00:00
a9f8a33893 remove sys_alloca (difficult to wrap in a sysdep function) and eliminate the need for it
debug: when building error message, use mmap instead of alloca
scheduler: remove reference to deleted header

This was SVN commit r5019.
2007-05-02 16:42:27 +00:00
5a427440d0 #SwEng
fpclassify fix
EntityManager: rename getExtant -> GetExtantAsHandles, fix its
implementation+call site to avoid dynamic alloc/auto ptr, rename extant
-> IsExtant
vsnprintf2 -> sys_vsnprintf. remove printf.h (function is declared in
sysdep header)
use SUS/posix-ish strcasecmp instead of defining that to the
windows-only stricmp
add cppdoc for ia32/cpu

This was SVN commit r5011.
2007-04-30 19:58:04 +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
623e649acb # big refactoring in CPU-specific code, fix for dual core vs. HT detection
all cpu-related stuff is now defined in cpu.h (with cpu_ prefix and
fully encapsulated). fix quite brittle core/HT unit/package detection.
implement mkdir on VC8, where it is deprecated
add strdup on MacOSX
move ia32 code into separate subdir. functions implemented in asm are
called ia32_asm_*.
add some unix versions of sysdep functions (cannot test them)
timer: fix for amd64 linux

This was SVN commit r4995.
2007-04-25 18:19:35 +00:00
e8a0626248 # improvements to foundation code
(merged in from thesis project branch)

allocator: remember page-aligned size (prevent resize error)
config, sysdep, lib: add implementation of wcsdup for macosX
path_util: add path_package_copy and cleanup
file: add dir_exists, dir_create uses _mkdir (avoids mode_t param)

This was SVN commit r4984.
2007-04-22 16:43:54 +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
8094125b18 Avoided "unknown pragma" warning in VS2003.
restrict: Changed documentation to note that it can be used on member
functions to restrict 'this', since that seems to work in GCC and MSVC
(though undocumented in the latter). Removed ICC-specific keyword
spelling because it accepts the GCC/MSVC spellings too.

This was SVN commit r4754.
2007-01-07 18:09:14 +00:00
d34ef783bf (Whoops, wrong version number)
This was SVN commit r4741.
2007-01-06 02:48:32 +00:00
ab94e73385 Added 'restrict' support for non-GCC compilers (partly to benefit from the optimisation, partly to make it more likely that bugs will be found if restrict is ever used incorrectly).
Renamed to 'RESTRICT' so it doesn't conflict with __declspec(restrict)
in MSVC's standard headers.

This was SVN commit r4740.
2007-01-06 01:33:13 +00:00
13f2e3ca0c Tried compiling with ICC9 on Linux, which raised various issues:
* Fixed some bugs with incorrect macro usage (SDL_BYTE_ORDER vs
SDL_BYTEORDER, {MSC,GCC}_VER vs {MSC,GCC}_VERSION, OS_WIN/OS_UNIX in
projects where they're not defined).
 * Removed some redundant declarations of g_Console.
 * Removed some unnecessary semicolons.
 * Removed some unused variables.
 * Added throw specification to operator new.

This was SVN commit r4698.
2006-12-16 01:01:15 +00:00
9d34e32c34 rename DIR_SEP to SYS_DIR_SEP (it being it sysdep.h, where most everything is thus prefixed)
another crack at #159; no longer use SYS_DIR_SEP. reason is that the
self-test uses windows AND unix paths, so both must always work on all
platforms.

This was SVN commit r4646.
2006-11-18 17:48:49 +00:00
a265a441fd # Fixed string handling for Windows/Linux compatibility.
* vsnprintf2: Made compatible between GCC and MSVC - it now always
null-terminates the buffer, and returns -1 on overflow. Fixes #158.
Added tests.
 * MeshManager: Use shared_ptr.expired() instead of checking for
bad_weak_ptr exception.
 * Xeromyces: Added tests for GetXMBPath, because it does unusual things
in sscanf which MSVC's /analyze complains about.
 * ConfigDB, ScriptGlue: Replaced some asserts with return-on-failure,
to avoid invalid array accesses when continuing after the assert (as
complained about by /analyze).
 * CStr: Removed "using namespace std". Added tests for handling of
invalid UTF-8.

This was SVN commit r4625.
2006-11-07 21:03:13 +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
245496e201 Fixed warnings/errors/leaks related to Xerces update
This was SVN commit r4303.
2006-09-04 20:59:21 +00:00
dave
3b41b5fbd1 Moved the include of cmath out of the #ifdef
This avoids stuff like

/usr/include/c++/4.0.0/cmath:85: error: template with C linkage
/usr/include/c++/4.0.0/cmath: In function 'float std::abs(float)':
/usr/include/c++/4.0.0/cmath:92: error: declaration of C function 'float
std::abs(float)' conflicts with
/usr/include/c++/4.0.0/cmath:88: error: previous declaration 'double
std::abs(double)' here

This was SVN commit r4291.
2006-09-03 02:17:57 +00:00