Fix C API header compatibility with C compilers (#2369)

This commit is contained in:
Artem Krylysov 2017-06-02 13:14:30 -04:00 committed by Tianqi Chen
parent 97abfc487a
commit ed8da45f9d

View File

@ -7,16 +7,16 @@
#ifndef XGBOOST_C_API_H_ #ifndef XGBOOST_C_API_H_
#define XGBOOST_C_API_H_ #define XGBOOST_C_API_H_
#include <cstdint>
#ifdef __cplusplus #ifdef __cplusplus
#define XGB_EXTERN_C extern "C" #define XGB_EXTERN_C extern "C"
#include <cstdio>
#else
#define XGB_EXTERN_C
#include <stdio.h>
#include <stdint.h>
#endif #endif
// XGBoost C API will include APIs in Rabit C API // XGBoost C API will include APIs in Rabit C API
XGB_EXTERN_C {
#include <stdio.h>
}
#include <rabit/c_api.h> #include <rabit/c_api.h>
#if defined(_MSC_VER) || defined(_WIN32) #if defined(_MSC_VER) || defined(_WIN32)