Merge "Clean up and explain libs_utils.h^WCHECK.h." into main am: 1529990938

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2966822

Change-Id: I33b321578760c3dcf0c10ddf704386508fa2938d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Elliott Hughes 2024-02-16 16:27:01 +00:00 committed by Automerger Merge Worker
commit bb009466b6
6 changed files with 11 additions and 14 deletions

View file

@ -14,14 +14,13 @@
* limitations under the License.
*/
#ifndef LIBS_UTILS_H
#define LIBS_UTILS_H
#pragma once
// Tests proper can use libbase, but libraries for testing dlopen()
// should probably avoid dependencies other than ones we're specifically
// trying to test.
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#define CHECK(e) \
((e) ? static_cast<void>(0) : __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, #e))
#endif // LIBS_UTILS_H
((e) ? static_cast<void>(0) : __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, #e))

View file

@ -14,11 +14,10 @@
* limitations under the License.
*/
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include "libs_utils.h"
#include "CHECK.h"
// This library is built for all targets, including host tests, so __cfi_slowpath may not be
// present. But it is only used in the bionic loader tests.

View file

@ -14,10 +14,9 @@
* limitations under the License.
*/
#include <assert.h>
#include <dlfcn.h>
#include "libs_utils.h"
#include "CHECK.h"
int main(void) {
void* handle;

View file

@ -19,7 +19,7 @@
#include <unistd.h>
#include <sys/auxv.h>
#include "libs_utils.h"
#include "CHECK.h"
static unsigned long g_AT_RANDOM;
static unsigned long g_AT_PAGESZ;

View file

@ -19,7 +19,7 @@
#include <unistd.h>
#include <sys/auxv.h>
#include "libs_utils.h"
#include "CHECK.h"
static ssize_t g_result;
static int g_errno;

View file

@ -28,7 +28,7 @@
#include <bionic/malloc.h>
#include "libs_utils.h"
#include "CHECK.h"
#if defined(__aarch64__)