while (0) -> while (/*CONSTCOND*/0)
This commit is contained in:
parent
ae2945399a
commit
c80991c598
8
external/bsd/libelf/dist/_libelf.h
vendored
8
external/bsd/libelf/dist/_libelf.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: _libelf.h,v 1.1.1.1 2009/12/19 05:43:39 thorpej Exp $ */
|
||||
/* $NetBSD: _libelf.h,v 1.2 2009/12/19 05:55:37 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Joseph Koshy
|
||||
@ -63,7 +63,7 @@ extern struct _libelf_globals _libelf;
|
||||
#define LIBELF_SET_ERROR(E, O) do { \
|
||||
LIBELF_PRIVATE(error) = ((ELF_E_##E & LIBELF_ELF_ERROR_MASK)| \
|
||||
((O) << LIBELF_OS_ERROR_SHIFT)); \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define LIBELF_ADJUST_AR_SIZE(S) (((S) + 1U) & ~1U)
|
||||
|
||||
@ -145,7 +145,7 @@ enum {
|
||||
return (0); \
|
||||
} \
|
||||
(DST)->NAME = (SRC)->NAME; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define LIBELF_COPY_S32(DST,SRC,NAME) do { \
|
||||
if ((SRC)->NAME > INT_MAX || \
|
||||
@ -154,7 +154,7 @@ enum {
|
||||
return (0); \
|
||||
} \
|
||||
(DST)->NAME = (SRC)->NAME; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
|
||||
/*
|
||||
|
6
external/bsd/libelf/dist/elf_scn.c
vendored
6
external/bsd/libelf/dist/elf_scn.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: elf_scn.c,v 1.1.1.1 2009/12/19 05:43:39 thorpej Exp $ */
|
||||
/* $NetBSD: elf_scn.c,v 1.2 2009/12/19 05:55:37 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Joseph Koshy
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
/* __FBSDID("$FreeBSD: src/lib/libelf/elf_scn.c,v 1.2.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
|
||||
__RCSID("$NetBSD: elf_scn.c,v 1.1.1.1 2009/12/19 05:43:39 thorpej Exp $");
|
||||
__RCSID("$NetBSD: elf_scn.c,v 1.2 2009/12/19 05:55:37 thorpej Exp $");
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
@ -63,7 +63,7 @@ _libelf_load_scn(Elf *e, void *ehdr)
|
||||
LIBELF_SET_ERROR(HEADER, 0); \
|
||||
return (0); \
|
||||
} \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
ec = e->e_class;
|
||||
fsz = _libelf_fsize(ELF_T_SHDR, ec, e->e_version, (size_t) 1);
|
||||
|
6
external/bsd/libelf/dist/elf_update.c
vendored
6
external/bsd/libelf/dist/elf_update.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: elf_update.c,v 1.1.1.1 2009/12/19 05:43:40 thorpej Exp $ */
|
||||
/* $NetBSD: elf_update.c,v 1.2 2009/12/19 05:55:37 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006-2008 Joseph Koshy
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
/* __FBSDID("$FreeBSD: src/lib/libelf/elf_update.c,v 1.5.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
|
||||
__RCSID("$NetBSD: elf_update.c,v 1.1.1.1 2009/12/19 05:43:40 thorpej Exp $");
|
||||
__RCSID("$NetBSD: elf_update.c,v 1.2 2009/12/19 05:55:37 thorpej Exp $");
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <sys/param.h>
|
||||
@ -430,7 +430,7 @@ _libelf_resync_elf(Elf *e)
|
||||
(size_t) 1); \
|
||||
(E)->e_shentsize = _libelf_fsize(ELF_T_SHDR, (EC), (V), \
|
||||
(size_t) 1); \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
if (ec == ELFCLASS32)
|
||||
INITIALIZE_EHDR(eh32, ec, eh_version);
|
||||
|
6
external/bsd/libelf/dist/libelf_allocate.c
vendored
6
external/bsd/libelf/dist/libelf_allocate.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: libelf_allocate.c,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $ */
|
||||
/* $NetBSD: libelf_allocate.c,v 1.2 2009/12/19 05:55:37 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Joseph Koshy
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
/* __FBSDID("$FreeBSD: src/lib/libelf/libelf_allocate.c,v 1.2.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
|
||||
__RCSID("$NetBSD: libelf_allocate.c,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $");
|
||||
__RCSID("$NetBSD: libelf_allocate.c,v 1.2 2009/12/19 05:55:37 thorpej Exp $");
|
||||
|
||||
#include <sys/errno.h>
|
||||
|
||||
@ -91,7 +91,7 @@ _libelf_init_elf(Elf *e, Elf_Kind kind)
|
||||
#define FREE(P) do { \
|
||||
if (P) \
|
||||
free(P); \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
|
||||
Elf *
|
||||
|
6
external/bsd/libelf/dist/libelf_ar.c
vendored
6
external/bsd/libelf/dist/libelf_ar.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: libelf_ar.c,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $ */
|
||||
/* $NetBSD: libelf_ar.c,v 1.2 2009/12/19 05:55:37 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Joseph Koshy
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
/* __FBSDID("$FreeBSD: src/lib/libelf/libelf_ar.c,v 1.3.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
|
||||
__RCSID("$NetBSD: libelf_ar.c,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $");
|
||||
__RCSID("$NetBSD: libelf_ar.c,v 1.2 2009/12/19 05:55:37 thorpej Exp $");
|
||||
|
||||
#include <ar.h>
|
||||
#include <assert.h>
|
||||
@ -416,7 +416,7 @@ _libelf_ar_open(Elf *e)
|
||||
(V) += (P)[1]; (V) <<= 8; \
|
||||
(V) += (P)[2]; (V) <<= 8; \
|
||||
(V) += (P)[3]; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define INTSZ 4
|
||||
|
||||
|
30
external/bsd/libelf/dist/libelf_convert.m4
vendored
30
external/bsd/libelf/dist/libelf_convert.m4
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $ */
|
||||
/* $NetBSD: libelf_convert.m4,v 1.2 2009/12/19 05:55:37 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006,2007 Joseph Koshy
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
/* __FBSDID("$FreeBSD: src/lib/libelf/libelf_convert.m4,v 1.4.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
|
||||
__RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $");
|
||||
__RCSID("$NetBSD: libelf_convert.m4,v 1.2 2009/12/19 05:55:37 thorpej Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/elf32.h>
|
||||
@ -52,7 +52,7 @@ __RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $"
|
||||
uint16_t _t = _x & 0xFF; \
|
||||
_t <<= 8; _x >>= 8; _t |= _x & 0xFF; \
|
||||
(X) = _t; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
#define SWAP_WORD(X) do { \
|
||||
uint32_t _x = (uint32_t) (X); \
|
||||
uint32_t _t = _x & 0xFF; \
|
||||
@ -60,7 +60,7 @@ __RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $"
|
||||
_t <<= 8; _x >>= 8; _t |= _x & 0xFF; \
|
||||
_t <<= 8; _x >>= 8; _t |= _x & 0xFF; \
|
||||
(X) = _t; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
#define SWAP_ADDR32(X) SWAP_WORD(X)
|
||||
#define SWAP_OFF32(X) SWAP_WORD(X)
|
||||
#define SWAP_SWORD(X) SWAP_WORD(X)
|
||||
@ -75,7 +75,7 @@ __RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $"
|
||||
_t <<= 8; _x >>= 8; _t |= _x & 0xFF; \
|
||||
_t <<= 8; _x >>= 8; _t |= _x & 0xFF; \
|
||||
(X) = _t; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
#define SWAP_ADDR64(X) SWAP_WORD64(X)
|
||||
#define SWAP_LWORD(X) SWAP_WORD64(X)
|
||||
#define SWAP_OFF64(X) SWAP_WORD64(X)
|
||||
@ -91,7 +91,7 @@ __RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $"
|
||||
unsigned char *const _p = (unsigned char *) (P); \
|
||||
_p[0] = (unsigned char) (X); \
|
||||
(P) = _p + 1; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
#define WRITE_HALF(P,X) do { \
|
||||
uint16_t _t = (X); \
|
||||
unsigned char *const _p = (unsigned char *) (P); \
|
||||
@ -99,7 +99,7 @@ __RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $"
|
||||
_p[0] = _q[0]; \
|
||||
_p[1] = _q[1]; \
|
||||
(P) = _p + 2; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
#define WRITE_WORD(P,X) do { \
|
||||
uint32_t _t = (X); \
|
||||
unsigned char *const _p = (unsigned char *) (P); \
|
||||
@ -109,7 +109,7 @@ __RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $"
|
||||
_p[2] = _q[2]; \
|
||||
_p[3] = _q[3]; \
|
||||
(P) = _p + 4; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
#define WRITE_ADDR32(P,X) WRITE_WORD(P,X)
|
||||
#define WRITE_OFF32(P,X) WRITE_WORD(P,X)
|
||||
#define WRITE_SWORD(P,X) WRITE_WORD(P,X)
|
||||
@ -126,7 +126,7 @@ __RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $"
|
||||
_p[6] = _q[6]; \
|
||||
_p[7] = _q[7]; \
|
||||
(P) = _p + 8; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
#define WRITE_ADDR64(P,X) WRITE_WORD64(P,X)
|
||||
#define WRITE_LWORD(P,X) WRITE_WORD64(P,X)
|
||||
#define WRITE_OFF64(P,X) WRITE_WORD64(P,X)
|
||||
@ -135,7 +135,7 @@ __RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $"
|
||||
#define WRITE_IDENT(P,X) do { \
|
||||
(void) memcpy((P), (X), sizeof((X))); \
|
||||
(P) = (P) + EI_NIDENT; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
/*
|
||||
* Read in various integral values. The source pointer could be
|
||||
@ -148,7 +148,7 @@ __RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $"
|
||||
(const unsigned char *) (P); \
|
||||
(X) = _p[0]; \
|
||||
(P) = (P) + 1; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
#define READ_HALF(P,X) do { \
|
||||
uint16_t _t; \
|
||||
unsigned char *const _q = (unsigned char *) &_t; \
|
||||
@ -158,7 +158,7 @@ __RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $"
|
||||
_q[1] = _p[1]; \
|
||||
(P) = (P) + 2; \
|
||||
(X) = _t; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
#define READ_WORD(P,X) do { \
|
||||
uint32_t _t; \
|
||||
unsigned char *const _q = (unsigned char *) &_t; \
|
||||
@ -170,7 +170,7 @@ __RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $"
|
||||
_q[3] = _p[3]; \
|
||||
(P) = (P) + 4; \
|
||||
(X) = _t; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
#define READ_ADDR32(P,X) READ_WORD(P,X)
|
||||
#define READ_OFF32(P,X) READ_WORD(P,X)
|
||||
#define READ_SWORD(P,X) READ_WORD(P,X)
|
||||
@ -189,7 +189,7 @@ __RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $"
|
||||
_q[7] = _p[7]; \
|
||||
(P) = (P) + 8; \
|
||||
(X) = _t; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
#define READ_ADDR64(P,X) READ_WORD64(P,X)
|
||||
#define READ_LWORD(P,X) READ_WORD64(P,X)
|
||||
#define READ_OFF64(P,X) READ_WORD64(P,X)
|
||||
@ -198,7 +198,7 @@ __RCSID("$NetBSD: libelf_convert.m4,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $"
|
||||
#define READ_IDENT(P,X) do { \
|
||||
(void) memcpy((X), (P), sizeof((X))); \
|
||||
(P) = (P) + EI_NIDENT; \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define ROUNDUP2(V,N) (V) = ((((V) + (N) - 1)) & ~((N) - 1))
|
||||
|
||||
|
6
external/bsd/libelf/dist/libelf_ehdr.c
vendored
6
external/bsd/libelf/dist/libelf_ehdr.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: libelf_ehdr.c,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $ */
|
||||
/* $NetBSD: libelf_ehdr.c,v 1.2 2009/12/19 05:55:37 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Joseph Koshy
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
/* __FBSDID("$FreeBSD: src/lib/libelf/libelf_ehdr.c,v 1.2.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
|
||||
__RCSID("$NetBSD: libelf_ehdr.c,v 1.1.1.1 2009/12/19 05:43:41 thorpej Exp $");
|
||||
__RCSID("$NetBSD: libelf_ehdr.c,v 1.2 2009/12/19 05:55:37 thorpej Exp $");
|
||||
|
||||
#include <assert.h>
|
||||
#include <gelf.h>
|
||||
@ -99,7 +99,7 @@ _libelf_load_extended(Elf *e, int ec, uint64_t shoff, uint16_t phnum,
|
||||
eh->e_machine = EM_NONE; \
|
||||
eh->e_type = ELF_K_NONE; \
|
||||
eh->e_version = LIBELF_PRIVATE(version); \
|
||||
} while (0)
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
void *
|
||||
_libelf_ehdr(Elf *e, int ec, int allocate)
|
||||
|
Loading…
Reference in New Issue
Block a user