diff options
author | Christopher Haster <chaster@utexas.edu> | 2018-08-05 04:33:09 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2018-10-16 19:33:00 +0300 |
commit | 6d0a6fc4622d0a48ab790d2b430048c8b32c606c (patch) | |
tree | 41fe9e997a7e186253041de68e18ff5092b8b227 /lfs_util.h | |
parent | 3186e89b14acdbd162911bc6af89ab94489a2a0a (diff) | |
parent | 510cd13df99843174899aa3ddabcbc889c7872e8 (diff) |
Merge remote-tracking branch 'origin/master' into v2-alpha
Diffstat (limited to 'lfs_util.h')
-rw-r--r-- | lfs_util.h | 28 |
1 files changed, 15 insertions, 13 deletions
@@ -1,19 +1,8 @@ /* * lfs utility functions * - * Copyright (c) 2017 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (c) 2017, Arm Limited. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause */ #ifndef LFS_UTIL_H #define LFS_UTIL_H @@ -34,6 +23,7 @@ #include <stdint.h> #include <stdbool.h> #include <string.h> +#include <inttypes.h> #ifndef LFS_NO_MALLOC #include <stdlib.h> @@ -45,6 +35,11 @@ #include <stdio.h> #endif +#ifdef __cplusplus +extern "C" +{ +#endif + // Macros, may be replaced by system specific wrappers. Arguments to these // macros must not have side-effects as the macros can be removed for a smaller @@ -199,6 +194,7 @@ static inline void *lfs_malloc(size_t size) { #ifndef LFS_NO_MALLOC return malloc(size); #else + (void)size; return NULL; #endif } @@ -207,9 +203,15 @@ static inline void *lfs_malloc(size_t size) { static inline void lfs_free(void *p) { #ifndef LFS_NO_MALLOC free(p); +#else + (void)p; #endif } +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif #endif |