Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
6b288215
Commit
6b288215
authored
Nov 29, 2016
by
Guolin Ke
Browse files
fix keyword error in VS2013
parent
81f45947
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
include/LightGBM/c_api.h
include/LightGBM/c_api.h
+4
-1
include/LightGBM/utils/log.h
include/LightGBM/utils/log.h
+4
-0
No files found.
include/LightGBM/c_api.h
View file @
6b288215
...
@@ -495,9 +495,12 @@ ColumnFunctionFromCSC(const void* col_ptr, int col_ptr_type, const int32_t* indi
...
@@ -495,9 +495,12 @@ ColumnFunctionFromCSC(const void* col_ptr, int col_ptr_type, const int32_t* indi
std
::
vector
<
double
>
std
::
vector
<
double
>
SampleFromOneColumn
(
const
std
::
vector
<
std
::
pair
<
int
,
double
>>&
data
,
const
std
::
vector
<
int
>&
indices
);
SampleFromOneColumn
(
const
std
::
vector
<
std
::
pair
<
int
,
double
>>&
data
,
const
std
::
vector
<
int
>&
indices
);
#if defined(_MSC_VER)
// exception handle and error msg
// exception handle and error msg
static
char
*
LastErrorMsg
()
{
static
__declspec
(
thread
)
char
err_msg
[
512
]
=
"Everything is fine"
;
return
err_msg
;
}
#else
static
char
*
LastErrorMsg
()
{
static
thread_local
char
err_msg
[
512
]
=
"Everything is fine"
;
return
err_msg
;
}
static
char
*
LastErrorMsg
()
{
static
thread_local
char
err_msg
[
512
]
=
"Everything is fine"
;
return
err_msg
;
}
#endif
inline
void
LGBM_SetLastError
(
const
char
*
msg
)
{
inline
void
LGBM_SetLastError
(
const
char
*
msg
)
{
std
::
strcpy
(
LastErrorMsg
(),
msg
);
std
::
strcpy
(
LastErrorMsg
(),
msg
);
...
...
include/LightGBM/utils/log.h
View file @
6b288215
...
@@ -89,7 +89,11 @@ private:
...
@@ -89,7 +89,11 @@ private:
// a trick to use static variable in header file.
// a trick to use static variable in header file.
// May be not good, but avoid to use an additional cpp file
// May be not good, but avoid to use an additional cpp file
#if defined(_MSC_VER)
static
LogLevel
&
GetLevel
()
{
static
__declspec
(
thread
)
LogLevel
level
=
LogLevel
::
Info
;
return
level
;
}
#else
static
LogLevel
&
GetLevel
()
{
static
thread_local
LogLevel
level
=
LogLevel
::
Info
;
return
level
;
}
static
LogLevel
&
GetLevel
()
{
static
thread_local
LogLevel
level
=
LogLevel
::
Info
;
return
level
;
}
#endif
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment