First cut at minibind classes.
[minibind.git] / jni / minibind / common.h
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MINIBIND_COMMON_H_
6
7 #include <android/log.h>
8 #include <errno.h>
9
10 #define ALOG(...) __android_log_print(ANDROID_LOG_WARN, "minibind", __VA_ARGS__)
11
12 #define AERR(msg) ALOG(msg ": %s", strerror(errno))
13
14 #define CHECK(cond) if (!(cond)) { ALOG("ASSERTION FAILURE: %s @ %s:%d", #cond, __FILE__, __LINE__ ); abort(); }
15
16 #define BINDER_VM_SIZE ((1*1024*1024) - (4096 *2))
17
18 #define DISALLOW_COPY_AND_ASSIGN(cls) cls(const cls&) = delete
19
20 #endif // MINIBIND_COMMON_H_