[backport] [R] Remove unused assert definition. (#8526) (#8668)

This commit is contained in:
Jiaming Yuan 2023-01-13 04:55:29 +08:00 committed by GitHub
parent ccf43d4ba0
commit e803d06d8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 28 deletions

View File

@ -23,7 +23,6 @@ PKG_LIBS = @OPENMP_CXXFLAGS@ @OPENMP_LIB@ @ENDIAN_FLAG@ @BACKTRACE_LIB@ -pthread
OBJECTS= \ OBJECTS= \
./xgboost_R.o \ ./xgboost_R.o \
./xgboost_custom.o \ ./xgboost_custom.o \
./xgboost_assert.o \
./init.o \ ./init.o \
$(PKGROOT)/src/metric/metric.o \ $(PKGROOT)/src/metric/metric.o \
$(PKGROOT)/src/metric/elementwise_metric.o \ $(PKGROOT)/src/metric/elementwise_metric.o \

View File

@ -23,7 +23,6 @@ PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) -DDMLC_CMAKE_LITTLE_ENDIAN=1 $(SHLIB_PTHRE
OBJECTS= \ OBJECTS= \
./xgboost_R.o \ ./xgboost_R.o \
./xgboost_custom.o \ ./xgboost_custom.o \
./xgboost_assert.o \
./init.o \ ./init.o \
$(PKGROOT)/src/metric/metric.o \ $(PKGROOT)/src/metric/metric.o \
$(PKGROOT)/src/metric/elementwise_metric.o \ $(PKGROOT)/src/metric/elementwise_metric.o \

View File

@ -1,26 +0,0 @@
// Copyright (c) 2014 by Contributors
#include <stdio.h>
#include <stdarg.h>
#include <Rinternals.h>
// implements error handling
void XGBoostAssert_R(int exp, const char *fmt, ...) {
char buf[1024];
if (exp == 0) {
va_list args;
va_start(args, fmt);
vsprintf(buf, fmt, args);
va_end(args);
error("AssertError:%s\n", buf);
}
}
void XGBoostCheck_R(int exp, const char *fmt, ...) {
char buf[1024];
if (exp == 0) {
va_list args;
va_start(args, fmt);
vsprintf(buf, fmt, args);
va_end(args);
error("%s\n", buf);
}
}