De-duplicate macro _CRT_SECURE_NO_WARNINGS / _CRT_SECURE_NO_DEPRECATE (#136)

* De-duplicate macro _CRT_SECURE_NO_WARNINGS / _CRT_SECURE_NO_DEPRECATE

* Move all macros to base.h

* Fix CI
This commit is contained in:
Philip Hyunsu Cho
2020-06-28 09:51:50 -07:00
committed by GitHub
parent 8fe7f5dc43
commit 74bf00a5ab
14 changed files with 61 additions and 39 deletions

19
include/rabit/base.h Normal file
View File

@@ -0,0 +1,19 @@
/*!
* Copyright (c) 2020 by Contributors
* \file base.h
* \brief Macros common to all headers
*
* \author Hyunsu Cho
*/
#ifndef RABIT_BASE_H_
#define RABIT_BASE_H_
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif // _CRT_SECURE_NO_WARNINGS
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE
#endif // _CRT_SECURE_NO_DEPRECATE
#endif // RABIT_BASE_H_

View File

@@ -6,7 +6,8 @@
*/
#ifndef RABIT_INTERNAL_UTILS_H_
#define RABIT_INTERNAL_UTILS_H_
#define _CRT_SECURE_NO_WARNINGS
#include <rabit/base.h>
#include <string.h>
#include <cstdio>
#include <string>