FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
arrayfire/src/api/cpp/exception.cpp at feature/optional-graphics · arrayfire/arrayfire · GitHub
arrayfire
arrayfire
Repository navigation
Code
Issues
292
(292)
Pull requests
39
(39)
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
arrayfire
/
src
/
api
/
cpp
/
exception.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
59 lines (47 loc) · 1.79 KB
Breadcrumbs
arrayfire
/
src
/
api
/
cpp
/
exception.cpp
Copy path
File metadata and controls
59 lines (47 loc) · 1.79 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
*******************************************************
*/
#
include
<
af/exception.h
>
#
include
<
algorithm
>
#
include
<
cstdio
>
#
include
<
cstring
>
//
strncpy
#
ifdef
OS_WIN
#
define
snprintf
_snprintf
#
endif
namespace
af
{
exception::exception
() : m_msg{}, m_err(
AF_ERR_UNKNOWN
) {
strncpy
(m_msg,
"
unknown exception
"
,
sizeof
(m_msg));
}
exception::exception
(
const
char
*msg) : m_msg{}, m_err(
AF_ERR_UNKNOWN
) {
strncpy
(m_msg, msg,
sizeof
(m_msg) -
1
);
m_msg[
sizeof
(m_msg) -
1
] =
'
\0
'
;
}
exception::exception
(
const
char
*file,
unsigned
line, af_err err)
: m_msg{}, m_err(err) {
snprintf
(m_msg,
sizeof
(m_msg) -
1
,
"
ArrayFire Exception (%s:%d):
\n
In %s:%u
"
,
af_err_to_string
(err),
static_cast
<
int
>(err), file, line);
m_msg[
sizeof
(m_msg) -
1
] =
'
\0
'
;
}
exception::exception
(
const
char
*msg,
const
char
*file,
unsigned
line,
af_err err)
: m_msg{}, m_err(err) {
snprintf
(m_msg,
sizeof
(m_msg) -
1
,
"
ArrayFire Exception (%s:%d):
\n
%s
\n
In %s:%u
"
,
af_err_to_string
(err),
static_cast
<
int
>(err), msg, file, line);
m_msg[
sizeof
(m_msg) -
1
] =
'
\0
'
;
}
exception::exception
(
const
char
*msg,
const
char
*func,
const
char
*file,
unsigned
line, af_err err)
: m_msg{}, m_err(err) {
snprintf
(m_msg,
sizeof
(m_msg) -
1
,
"
ArrayFire Exception (%s:%d):
\n
%s
\n
In function %s
\n
In file %s:%u
"
,
af_err_to_string
(err),
static_cast
<
int
>(err), msg, func, file,
line);
m_msg[
sizeof
(m_msg) -
1
] =
'
\0
'
;
}
}
//
namespace af
Back
|
FazBrowse Home
|
New Git URL