Commit Graph

89 Commits

Author SHA1 Message Date
davidpanderson 6f4b8e5d43 Fix some compile warnings on Win (VS 2022).
Remove outdated stuff (e.g. VS has snprintf() now).

I'd like to have a clean build (no warnings) on both VS and gcc.
Currently VS has a bunch of printf code warnings in
diagnostics.cpp, diagnostics_win.cpp, and stackwalker_win.cpp.
These should be easy to fix.
gcc has a bunch of sprintf buffer-size warnings, not easy to fix.
There are lots of warnings in zip (to be fixed with vcpkg?)
and in old graphics code.
2023-03-22 14:23:14 -07:00
davidpanderson 957e237e09 MinGW fix 2020-08-31 15:48:08 -07:00
davidpanderson 8b852cb2c9 Win code cleanup; no functional changes
Platform-wide #defines belong in .h files, not .cpp
Also fixed a couple of compiler warnings.
2020-08-31 13:56:15 -07:00
David Anderson 16712e73d0 Win compile fix 2019-11-20 10:53:15 -08:00
Veronica K. B. Olsen 6fe171a2cd
Moving winhttp.h instead of windows.h for MINGW build 2018-12-13 23:24:05 +01:00
Veronica K. B. Olsen 4f326368f4
Added include windows.h before winhttp.h when building with mingw 2018-12-13 11:51:31 +01:00
Juha Sointusalo 50a79e0f34 build: remove NO_PER_THREAD_LOCALE stuff
NO_PER_THREAD_LOCALE has been replaced by HAVE__CONFIGTHREADLOCALE and
HAVE_USELOCALE.

Also remove HAVE_DECL__CONFIGTHREADLOCALE which was used only for
NO_PER_THREAD_LOCALE.
2018-03-28 16:21:33 +03:00
David Anderson 13a5b9bf3e change multiple-inclusion guard names to BOINC_FILENAME_H 2017-04-07 23:54:49 -07:00
Yidong Ren 1d3cee5e0a Fix cross-compile from ubuntu with mingw 2017-02-16 00:08:51 -05:00
David Anderson cba89c6503 Win build: snprintf() fix for VS2015 2017-02-01 21:26:53 -08:00
David Anderson ca80cac75a Win build: manage compiler warnings better:
VS lets you choose the compiler warning level, 0 to 4.
Higher is good because compiler warnings often indicate bugs.
However, some warnings are noise, and having a lot of them is bad
because they conceal the important ones.
As an example, a recent update to VS2010 causes it to spew warnings of the form
"function _strdup() is deprecated; use _strdup() instead.

So the new policy is:
- everything compiles with warning level 4
- in boinc_win.h we use #pragmas to suppress 3 specific warnings
  that occur a lot in our code, and are not bugs:
  - the _function names as described above
  - constant conditional expression (like while(1))
  - conversion from int to char

And the goal is to build everything with zero warnings
except from outside code like zip.
We're pretty close to that.

The project files for other VS versions should be modified
to also use level 4 everywhere.
2017-01-27 01:27:32 -08:00
David Anderson d626dfd8d5 client/wrappers, Win: consolidate defines for _getcwd etc in boinc_win.h
They belong here, not in .cpp files
2017-01-26 20:59:11 -08:00
Rom Walton 2997944822 client: Let strlcat handle dealing with the buffer size and suppress the security warnings again. 2016-02-16 08:48:08 -05:00
Rom Walton 16e51ec218 LIB: Cleanup low hanging fruit with regards to cleaning up strcpy and strcat use.
Use safe_strcpy and safe_strcat when dealing with non-pointer data types.
2016-02-15 17:54:13 -05:00
Eric J Korpela ce37b73fc4 Fixed avx detection on GCC windows compiles
More windows library detection added to configure.ac
Additional cross compile fixes for libboinc and client.
2014-06-20 07:48:31 -07:00
Eric J Korpela f0626cf5fc Added explanatory comment 2014-05-08 14:17:03 -07:00
Eric J Korpela ebad3ff63f Fixes for Visual C++ problems caused by xcompile checkins. 2014-05-08 13:46:26 -07:00
Eric J Korpela 73b0a65e0e Cross compile fixes for mingw32.
Libraries now compile on the RHEL 6 standard cross compiling environment.
2014-05-02 15:40:59 -07:00
U-X1\korpela 34fbfd3297 WIN32 Cross Compile Fixes 2014-05-01 17:44:34 -07:00
U-X1\korpela 6f463af707 Merge branch 'master' of ssh://boinc.berkeley.edu/boinc-v2
Conflicts:
	lib/boinc_win.h
2014-04-29 08:02:31 -07:00
U-X1\korpela c6995ce06b These files aren't modified. Git claims otherwise.
Subversion was so much better then git.  I spend all my effing time dealing
with git's issues.  What a PITA.
2014-04-29 07:59:06 -07:00
U-X1\korpela 4a357acddc Changes for mingw32 cross compile 2014-04-29 07:50:33 -07:00
Timo Strunk 10a431eb2c MinGW also requires delayimp now 2014-04-28 14:37:39 -04:00
Rom Walton afb6dcc6f3 MGR & Client: Massive code clean-up. Remove as much of the LoadLibrary/GetProcAddress stuff as we can under VS 2012. 2014-03-06 18:27:54 -05:00
David Anderson 7e3f9d323a Win compile fixes 2014-01-30 23:15:03 -08:00
Bernd Machenschalk e2e9ecd3b3 Hotfix for MinGW build issue with Rom's commit:b9f8bea6 2014-01-28 08:42:31 -05:00
Rom Walton b9f8bea665 client: Give boinc_master full control of any process spawned using the service token created by the client for boinc_project.
This will allow the core client to kill VirtualBox VM's launched indirectly by vboxwrapper.  Vboxwrapper launches vboxsvc.exe which launches vboxheadless.exe.  This should also take care of the core client being able to kill child processes of the regular wrapper as well.  I don't know the full scope of this type of issue?  Maybe the default ACLs for a process changed within the last couple of versions of Windows.
2013-11-14 23:26:06 -05:00
David Anderson 5b740acee0 - client/manager: move the conditional define of MAXPATHLEN
from boinc_win.h to filesys.h,
	so that the client will hopefully build on Hurd,
	which doesn't define MAXPATHLEN.
2013-03-01 16:17:19 +01:00
David Anderson 76282d0a20 - Win compile fixes.
For now, include psapi.lib in various project properties.
		Try to figure out a different way.

svn path=/trunk/boinc/; revision=26149
2012-10-11 19:22:34 +00:00
David Anderson f022b566de - Win compile fixes
svn path=/trunk/boinc/; revision=25665
2012-05-09 20:06:54 +00:00
David Anderson 77e3c4d06c - API: compile fixes for MinGW. From Oliver Bock.
svn path=/trunk/boinc/; revision=24474
2011-10-24 23:38:19 +00:00
Eric J. Korpela bb4d2ec479 Fixes for MinGW build with GCC 4.5 and 3.X
svn path=/trunk/boinc/; revision=23631
2011-06-02 16:25:30 +00:00
David Anderson 4a4ee2a013 - API: compile fixes for MinGW. Fixes #955. from Matt Arsenault
svn path=/trunk/boinc/; revision=23282
2011-03-26 02:19:21 +00:00
Bernd Machenschalk a73bbac1dc lib:
- fixed whitespace error in Makefile.mingw                                                                                                                                                  
        - build and install svn_version.h in Makefile.mingw                                                                                                                                         
        - fixed boinc_win.h for MinGW gcc-4                                                                                                                                                         
        - not sure why client_msgs.h was ever included in procinfo_unix.cpp,                                                                                                                      
          but in current code caused a nasty trail of includes breaking the                                                                                                                         
          Linux build, so removed it

svn path=/trunk/boinc/; revision=22561
2010-10-20 11:28:02 +00:00
David Anderson 50724b0ed9 - API: compile fixes for MinGW
svn path=/trunk/boinc/; revision=21522
2010-05-14 16:22:57 +00:00
Rom Walton 9cb3e6ffc7 - client & lib: bring header inclusion up-to-date for the CC to begin
hunting down a memory leak.
        
    client/
        <Various Files>
    lib/
        <Various Files>

svn path=/trunk/boinc/; revision=21457
2010-05-11 19:10:29 +00:00
Rom Walton 9961002b4c - Define HAVE_ALLOCA in boinc_win.h so that any component using
strcasestr in str_util.cpp uses stack allocations instead of
      more expensive heap allocations.
    - Move remaining HAVE_* defines from project files to boinc_win.h

    lib/
        boinc_win.h
    win_build/
        *.vcproc

svn path=/trunk/boinc/; revision=20928
2010-03-16 18:53:55 +00:00
Rom Walton a5bbf07ccc - client: Add a function to the client software to be able to detect
the number of bytes sent and received across all non-loopback
        interfaces.
        
    client/
        hostinfo_win.cpp

svn path=/trunk/boinc/; revision=20704
2010-02-23 05:13:54 +00:00
Bernd Machenschalk cdcbfc29fd api: updates for building Win32 libs & API with MinGW gcc
added Makefile.mingw used for Einstein@home in lib/ as an
_alternative_ to api/Makefile.mingw

svn path=/trunk/boinc/; revision=19583
2009-11-16 13:13:42 +00:00
Rom Walton 329303b323 - Remove need for boinc.dll from the client.
client/
        hostinfo_win.cpp
        main.cpp
    clientctrl/
        boincsvcctrl.cpp
    clientgui/
        BOINCClientManager.cpp
        BOINCGUIApp.cpp
        BOINCGUIApp.h
        stdwx.h
    clienttray/
        tray_win.cpp
        tray_win.h
    lib/
        boinc_win.h
        daemonmgt.cpp (Deleted)
        daemonmgt.h (Added)
        daemonmgt_win.cpp (Added)
        idlemon.h (Added)
        idlemon_win.cpp (Added)
        idlemon_win.h (Deleted)
    win_build/
        boinc.sln
        boinc_dll.vcproj
        boincmgr.vcproj
        boincsvcctrl.vcproj
        boinctray.vcproj
        libboinc.vcproj

svn path=/trunk/boinc/; revision=19576
2009-11-13 21:23:15 +00:00
Rom Walton c73ea50c1b - On Windows treat all SEH exceptions as C++ style exceptions.
NOTE: I'll need to do a little more research and adjust the
          diagnostics stuff later.  I believe that the diagnostics
          framework will now always report an unhandled C++ exception
          for things like an Access Violation.
    - client: On Windows, recover from an Access Violation if/when 
        the GPU functions access violate.
        
    lib/
        boinc_in.h
        coproc.cpp
    win_build/
        *.vcproj

svn path=/trunk/boinc/; revision=19541
2009-11-11 20:33:12 +00:00
Bernd Machenschalk 3f38b286d3 lib: some changes to help building the WIN32 library with MinGW/gcc
enable by defining MINGW_WIN32 macro, nothing should change if
this is not set

svn path=/trunk/boinc/; revision=19280
2009-10-07 19:17:52 +00:00
David Anderson 563a55f37e - client/libs/samples: remove "#define read _read" etc. from boinc_win.h
These cause problems when "read" is a member name, etc.
		Do these #defines, conditioned on _MSC_VER,
		in the files that actually need them.
	- don't include boinc_win.h from parse.h.
		principle of minimal inclusion

svn path=/trunk/boinc/; revision=18902
2009-08-22 17:00:19 +00:00
Rom Walton fec945221e - client: Initial swipe at automatic proxy server configuration
detection on Windows.  Fixes #35
        
    client/
        cs_cmdline.cpp
        http_curl.cpp
        http_curl.h
    lib/
        boinc_win.h
        proxy_info.cpp
        proxy_info.h
        util.cpp
        win_util.h

svn path=/trunk/boinc/; revision=18772
2009-07-29 23:50:00 +00:00
Rom Walton 28c72cab79 - WIN: First pass through the code to fix compliation errors when
building in a Unicode enabled environment.
        
        NOTE: For files that are shared between the core client and
          the manager, it was simpliar to just call the ANSI versions
          of the specific Windows API functions then to monkey with
          all of the string handling code and convert between ANSI
          and UCS-2 strings.  CreateFile becomes CreateFileA instead
          of the default of CreateFileW.
          
        Down to 11 compile time errors from over 100.

    clientgui/
        BOINCBaseFrame.cpp
        BOINCTaskBar.cpp
        browser.cpp
        browser.h
        sg_StatImageLoader.cpp
    lib/
        boinc_win.h
        diagnostics_win.cpp
        filesys.cpp
        gui_rpc_client_ops.cpp
        proc_control.cpp
        stackwalker_imports.h
        stackwalker_win.cpp
        str_util.cpp
        util.cpp
        win_util.cpp, .h

svn path=/trunk/boinc/; revision=17859
2009-04-23 03:40:49 +00:00
Eric J. Korpela 8f3abcc835 - Added checks for net/*.h, arpa/*.h, netinet/*.h and code to figure out
which of those files to include
    - Modified MAC address check to work on some non-Linux unixes.
      (mac_address.cpp)
    - Added suggested change to "already attached to project" checking.
      (ProjectInfoPage.cpp)
    - changed includes of standard c header files to their c++ equivalents
      (i.e. replaced <stdio.h> with <cstdio>) for namespace protection.
    - replaced "using namespace std;" with more explicit "using std::function" in
      several files.
    - Fixed bug in checking whether the os is OS/2 and added conditional OS_OS2
      to the build environment. (boinc_platform.m4,configure.ac)
    - Changed build environment to not use -nostandardlibs unless we are using
      G++ and static linkage is specified. (configure.ac)
    - Added makefiles and package building files for solaris CSW package manager.
    - Fixed bug with attempting to find login name using logname. (configure.ac)
    - Added ifdef HAVE_* protection around some include files commonly found in
      sys.
    - Added support for unified binary for x86_64/i686-pc-solaris.
      (cs_platforms.cpp)
    - generate_host_cpid() now uses MAC address on non-linux unix.
      (hostinfo_network.cpp)
    - Macro BOINC_SET_COMPILE_FLAGS now doesn't check gcc only flags on non-gcc
      compilers. (boinc_set_compile_flags.m4)
    - Library compiles no longer depend upon the library extension or require
      the library to be prefixed with lib.
    - More fixes for fcgi builds.
    - Added declaration of "struct ether_addr" and ether_ntoa().  Have not yet
      implemented ether_ntoa() for machines that don't have it, or where it is
      buggy.  (unix_util.h)
    - Added FCGI::perror() which calls FCGI_perror(). (boinc_fcgi.{h,cpp})
    - Fixed library Makefiles so that all required headers get installed.


svn path=/trunk/boinc/; revision=17388
2009-02-26 00:23:23 +00:00
David Anderson 4f66bb4c95 - added copyright and license info to .C, .cpp, .h files
- scheduler: fix bug in adaptive replication:
    if send an unreplicated job to untrusted host,
    set both wu.target_nresults and wu.min_quorum to app.target_nresults.

svn path=/trunk/boinc/; revision=15762
2008-08-06 18:36:30 +00:00
Rom Walton c2028c37fd - CLI: Adjust the shared memory ACLs so that everybody can read/write to
them, the default ACL limits read/write access to SYSTEM and boinc_master
        when run in secure mode.
        
    lib/
        boinc_win.h
        shmem.C

svn path=/trunk/boinc/; revision=14903
2008-03-12 18:23:48 +00:00
Rom Walton 75e334811a - client: prevent information disclosure by creating a new environment
block for applications launched using the 'boinc_project' account.
        
        Windows contains environment variables that describe username,
        domain name, profile directory and even logon server.
        
    - client: correctly parse domain name information from the
        client_auth.xml file when a different account is used for
        'boinc_master'.
    - SCR/MGR: Add two API's to adjust the ACLs on the current users
        desktop and windowstation so that graphics applications can
        properly create controls and dialogs for applications
        launched using 'boinc_project'.
        
    client/
        app_start.C
    lib/
        boinc_win.h
        util.C, .h
    lib/
        win_util.C, .h
    win_build/
        boinc_cli_curl.vcproj

svn path=/trunk/boinc/; revision=14748
2008-02-15 15:52:16 +00:00
David Anderson 41bd38148d Fixes missing routines and defines for MINGW32 application builds.
Also fixes some type warnings.


svn path=/trunk/boinc/; revision=14655
2008-01-31 18:34:51 +00:00