Changeset 34120f10 in mainline for common/stdc/cc.h


Ignore:
Timestamp:
2023-10-27T19:38:31Z (20 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, topic/msim-upgrade, topic/simplify-dev-export
Children:
63ed840
Parents:
c89ae25 (diff), 694ca3d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge code deduplication work

TL;DR: Added directory /common, which now contains the sole existing
copy of ADT, printf_core, and a few other pieces. Should make changes
to any of those less of a headache.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • common/stdc/cc.h

    rc89ae25 r34120f10  
    11/*
    2  * Copyright (c) 2001-2004 Jakub Jermar
     2 * Copyright (c) 2013 Vojtech Horky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
     29/** @addtogroup libc
     30 * @{
     31 */
    2932/** @file
     33 * Macros related to used compiler (such as GCC-specific attributes).
    3034 */
    3135
    32 #ifndef BOOT_MEMSTR_H_
    33 #define BOOT_MEMSTR_H_
     36#ifndef _LIBC_CC_H_
     37#define _LIBC_CC_H_
    3438
    35 #include <stddef.h>
     39#ifndef __clang__
     40#define ATTRIBUTE_OPTIMIZE(opt) \
     41    __attribute__ ((optimize(opt)))
     42#else
     43#define ATTRIBUTE_OPTIMIZE(opt)
     44#endif
    3645
    37 extern void *memcpy(void *, const void *, size_t)
    38     __attribute__((nonnull(1, 2)))
    39     __attribute__((optimize("-fno-tree-loop-distribute-patterns")));
    40 extern void *memset(void *, int, size_t)
    41     __attribute__((nonnull(1)))
    42     __attribute__((optimize("-fno-tree-loop-distribute-patterns")));
    43 extern void *memmove(void *, const void *, size_t)
    44     __attribute__((nonnull(1, 2)));
     46#define ATTRIBUTE_OPTIMIZE_NO_TLDP \
     47    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns")
     48
     49#ifdef CONFIG_LTO
     50#define DO_NOT_DISCARD __attribute__ ((used))
     51#else
     52#define DO_NOT_DISCARD
     53#endif
    4554
    4655#endif
Note: See TracChangeset for help on using the changeset viewer.