Remove compile warning messages
[platform/core/appfw/pkgmgr-info.git] / parser / src / pkgmgr_parser_debug.h
1 /*
2  * pkgmgrinfo_debug
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6   * Contact: junsuk. oh <junsuk77.oh@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef __PKGMGR_PARSER_DEBUG_H__
23 #define __PKGMGR_PARSER_DEBUG_H__
24
25 #include <dlog.h>
26
27 #define _LOGE(fmt, arg...) LOGE(fmt, ##arg)
28 #define _LOGI(fmt, arg...) LOGI(fmt, ##arg)
29 #define _LOGD(fmt, arg...) LOGD(fmt, ##arg)
30
31 #ifdef LOG_TAG
32 #undef LOG_TAG
33 #endif
34 #define LOG_TAG "PKGMGR_PARSER"
35
36 #define ret_if(expr) do { \
37         if (expr) { \
38                 _LOGE("(%s) ", #expr); \
39                 return; \
40         } \
41 } while (0)
42
43 #define retm_if(expr, fmt, arg...) do { \
44         if (expr) { \
45                 _LOGE("(%s) "fmt, #expr, ##arg); \
46                 return; \
47         } \
48 } while (0)
49
50 #define retv_if(expr, val) do { \
51         if (expr) { \
52                 _LOGE("(%s) ", #expr); \
53                 return (val); \
54         } \
55 } while (0)
56
57 #define retvm_if(expr, val, fmt, arg...) do { \
58         if (expr) { \
59                 _LOGE("(%s) "fmt, #expr, ##arg); \
60                 return (val); \
61         } \
62 } while (0)
63
64 #define trym_if(expr, fmt, arg...) do { \
65         if (expr) { \
66                 _LOGE("(%s) "fmt, #expr, ##arg); \
67                 goto catch; \
68         } \
69 } while (0)
70
71 #define tryvm_if(expr, val, fmt, arg...) do { \
72         if (expr) { \
73                 _LOGE("(%s) "fmt, #expr, ##arg); \
74                 val; \
75                 goto catch; \
76         } \
77 } while (0)
78
79 #endif  /* __PKGMGR_PARSER_DEBUG_H__ */