diff --git a/client/hostinfo_network.cpp b/client/hostinfo_network.cpp index c8877dae3b..f2209b4186 100644 --- a/client/hostinfo_network.cpp +++ b/client/hostinfo_network.cpp @@ -19,7 +19,6 @@ #ifdef _WIN32 #include "boinc_win.h" -#define getpid _getpid #else #include "config.h" #include @@ -41,10 +40,6 @@ #endif #endif -#ifdef _MSC_VER -#define snprintf _snprintf -#endif - #ifdef __APPLE__ #include #endif diff --git a/lib/app_ipc.cpp b/lib/app_ipc.cpp index 33b1ce9300..1ef96a3e7c 100644 --- a/lib/app_ipc.cpp +++ b/lib/app_ipc.cpp @@ -25,10 +25,6 @@ #include #endif -#ifdef _MSC_VER -#define snprintf _snprintf -#endif - #include "error_numbers.h" #include "filesys.h" #include "miofile.h" @@ -40,10 +36,6 @@ #include "app_ipc.h" -#if !defined(HAVE_STRDUP) && defined(HAVE__STRDUP) -#define strdup _strdup -#endif - using std::string; APP_INIT_DATA::APP_INIT_DATA() { diff --git a/lib/boinc_win.h b/lib/boinc_win.h index 9227f1f846..914f30a30c 100644 --- a/lib/boinc_win.h +++ b/lib/boinc_win.h @@ -15,17 +15,32 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . -// boinc_win.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently +// boinc_win.h : include file for Windows builds. +// Includes standard system include files, +// and aliases function names like getpid -> _getpid +// +// ?? Is this only for Visual Studio, or for MINGW too? +// comments below are contradictory #ifndef _BOINC_WIN_ #define _BOINC_WIN_ +#ifdef _MSC_VER +#define getpid _getpid +#define getcwd _getcwd +#define snprintf _snprintf +#define strdate _strdate +#define strdup _strdup +#define stricmp _stricmp +#define strtime _strtime +#endif + + #ifndef HAVE_CONFIG_H // Windows C Runtime Library -// These are version dependent. If you aren't using MSC, you'll probably need +// These are Visual Studio version dependent. +// If you aren't using VS, you'll probably need // to edit this file or create a config.h // For MINGW32 and MINGW64, it's best to run autoconf if possible. @@ -72,8 +87,6 @@ #define HAVE_DECL__FPRESET 1 #define HAVE_DECL___CPUID 1 #define HAVE_MSVCRT 1 -#undef HAVE_STRDUP -#define HAVE__STRDUP 1 #undef NO_PER_THREAD_LOCALE #define HAVE_DECL__CONFIGTHREADLOCALE 1 #define HAVE__CONFIGTHREADLOCALE 1 diff --git a/lib/diagnostics.cpp b/lib/diagnostics.cpp index d0d10d0010..5ae323596c 100644 --- a/lib/diagnostics.cpp +++ b/lib/diagnostics.cpp @@ -24,12 +24,6 @@ #include "stdwx.h" #endif -#if defined(_MSC_VER) || defined(__MINGW32__) -#define snprintf _snprintf -#define strdate _strdate -#define strtime _strtime -#endif - #ifdef __EMX__ #include #endif diff --git a/lib/diagnostics_win.cpp b/lib/diagnostics_win.cpp index 9e181c9259..183b763614 100644 --- a/lib/diagnostics_win.cpp +++ b/lib/diagnostics_win.cpp @@ -27,12 +27,6 @@ #include "win_util.h" #endif -#if defined(_MSC_VER) || defined(__MINGW32__) -#define snprintf _snprintf -#define strdate _strdate -#define strtime _strtime -#endif - #ifndef __CYGWIN32__ #include "stackwalker_win.h" #endif diff --git a/lib/parse.cpp b/lib/parse.cpp index 53ff8b0a2c..e1fb21aabf 100644 --- a/lib/parse.cpp +++ b/lib/parse.cpp @@ -39,14 +39,6 @@ #endif #endif -#ifdef _MSC_VER -#define snprintf _snprintf -#endif - -#if !defined(HAVE_STRDUP) && defined(HAVE__STRDUP) -#define strdup _strdup -#endif - #ifdef _USING_FCGI_ #include "boinc_fcgi.h" #endif diff --git a/lib/stackwalker_win.cpp b/lib/stackwalker_win.cpp index c2889deadc..d7a8301610 100644 --- a/lib/stackwalker_win.cpp +++ b/lib/stackwalker_win.cpp @@ -48,10 +48,6 @@ #include "stdwx.h" #endif -#ifdef _MSC_VER -#define snprintf _snprintf -#endif - #include "diagnostics.h" #include "str_replace.h" #include "str_util.h" diff --git a/lib/url.cpp b/lib/url.cpp index d6db7248cd..e5e1682d65 100644 --- a/lib/url.cpp +++ b/lib/url.cpp @@ -27,9 +27,6 @@ #include #include #endif -#ifdef _MSC_VER -#define snprintf _snprintf -#endif #include "str_util.h" #include "str_replace.h" diff --git a/lib/win_util.cpp b/lib/win_util.cpp index 80b2d90749..28253c55df 100644 --- a/lib/win_util.cpp +++ b/lib/win_util.cpp @@ -21,10 +21,6 @@ #include "stdwx.h" #endif -#if defined(_MSC_VER) || defined(__MINGW32__) -#define snprintf _snprintf -#endif - #include "diagnostics.h" #include "util.h" #include "filesys.h" diff --git a/samples/vboxwrapper/vbox_mscom42.cpp b/samples/vboxwrapper/vbox_mscom42.cpp index 5f927b79fa..5c473dd0a3 100644 --- a/samples/vboxwrapper/vbox_mscom42.cpp +++ b/samples/vboxwrapper/vbox_mscom42.cpp @@ -39,12 +39,6 @@ #include "vboxwrapper.h" #include "vbox_mscom42.h" - -#if defined(_MSC_VER) || defined(__MINGW32__) -#define stricmp _stricmp -#define snprintf _snprintf -#endif - #import "file:vbox42.tlb" rename_namespace("vbox42"), named_guids, raw_interfaces_only using std::string; @@ -65,4 +59,3 @@ namespace vbox42 { #include "vbox_mscom_impl.cpp" } - diff --git a/samples/vboxwrapper/vbox_mscom43.cpp b/samples/vboxwrapper/vbox_mscom43.cpp index 9964986048..8b302f488b 100644 --- a/samples/vboxwrapper/vbox_mscom43.cpp +++ b/samples/vboxwrapper/vbox_mscom43.cpp @@ -39,12 +39,6 @@ #include "vboxwrapper.h" #include "vbox_mscom43.h" - -#if defined(_MSC_VER) || defined(__MINGW32__) -#define stricmp _stricmp -#define snprintf _snprintf -#endif - #import "file:vbox43.tlb" rename_namespace("vbox43"), named_guids, raw_interfaces_only using std::string; diff --git a/samples/vboxwrapper/vbox_mscom50.cpp b/samples/vboxwrapper/vbox_mscom50.cpp index a0d0ee29dd..8f1bc5bacc 100644 --- a/samples/vboxwrapper/vbox_mscom50.cpp +++ b/samples/vboxwrapper/vbox_mscom50.cpp @@ -39,12 +39,6 @@ #include "vboxwrapper.h" #include "vbox_mscom50.h" - -#if defined(_MSC_VER) || defined(__MINGW32__) -#define stricmp _stricmp -#define snprintf _snprintf -#endif - #import "file:vbox50.tlb" rename_namespace("vbox50"), named_guids, raw_interfaces_only using std::string; diff --git a/samples/vboxwrapper/vbox_mscom51.cpp b/samples/vboxwrapper/vbox_mscom51.cpp index 5fdbd2dc6f..4cce445ca1 100644 --- a/samples/vboxwrapper/vbox_mscom51.cpp +++ b/samples/vboxwrapper/vbox_mscom51.cpp @@ -40,11 +40,6 @@ #include "vbox_mscom51.h" -#if defined(_MSC_VER) || defined(__MINGW32__) -#define stricmp _stricmp -#define snprintf _snprintf -#endif - #import "file:vbox51.tlb" rename_namespace("vbox51"), named_guids, raw_interfaces_only using std::string; diff --git a/samples/vboxwrapper/vbox_vboxmanage.cpp b/samples/vboxwrapper/vbox_vboxmanage.cpp index 24d9e0d1b5..52a2ab443e 100644 --- a/samples/vboxwrapper/vbox_vboxmanage.cpp +++ b/samples/vboxwrapper/vbox_vboxmanage.cpp @@ -39,12 +39,6 @@ using std::string; -#if defined(_MSC_VER) -#define getcwd _getcwd -#define stricmp _stricmp -#define snprintf _snprintf -#endif - #include "diagnostics.h" #include "filesys.h" #include "parse.h"