blob: fd61d9b4b61b3a4a831afbb1182060db21d0a231 [file] [log] [blame]
Stéphane Marchesin25a26062014-09-12 16:18:59 -07001/*
Daniele Castagna7a755de2016-12-16 17:32:30 -05002 * Copyright 2014 The Chromium OS Authors. All rights reserved.
Stéphane Marchesin25a26062014-09-12 16:18:59 -07003 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7#ifndef UTIL_H
8#define UTIL_H
9
10#define MAX(A, B) ((A) > (B) ? (A) : (B))
Gurchetan Singh1b1d56a2017-03-10 16:25:23 -080011#define ARRAY_SIZE(A) (sizeof(A) / sizeof(*(A)))
Stéphane Marchesin25a26062014-09-12 16:18:59 -070012#define PUBLIC __attribute__((visibility("default")))
Gurchetan Singh1b1d56a2017-03-10 16:25:23 -080013#define ALIGN(A, B) (((A) + (B)-1) / (B) * (B))
14#define DIV_ROUND_UP(n, d) (((n) + (d)-1) / (d))
Stéphane Marchesin25a26062014-09-12 16:18:59 -070015
16#endif