Nick Desaulniers cdbec7baf1
[libc] fix up the use of angle includes in include/ (#86027)
Performed en-masse via:

    $ grep -rn "#include <ll" libc/include -l | \
      xargs perl -pi -e 's/#include <ll(.*)>/#include "ll$1"/'
    $ grep -rn "#include <__" libc/include -l | \
      xargs perl -pi -e 's/#include <__(.*)>/#include "__$1"/'

Link: #83463
Link: #83210
2024-03-22 08:24:08 -07:00

21 lines
884 B
C

//===-- Definition of the containerof macro -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_MACROS_CONTAINEROF_MACRO_H
#define LLVM_LIBC_MACROS_CONTAINEROF_MACRO_H
#include "llvm-libc-macros/offsetof-macro.h"
#define __containerof(ptr, type, member) \
({ \
const __typeof(((type *)0)->member) *__ptr = (ptr); \
(type *)(void *)((const char *)__ptr - offsetof(type, member)); \
})
#endif // LLVM_LIBC_MACROS_CONTAINEROF_MACRO_H