libptpmgmt 2.0
libptpmgmt library that provides the functionality of linuxptp pmc
Loading...
Searching...
No Matches
name.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-3.0-or-later
2 SPDX-FileCopyrightText: Copyright © 2022 Erez Geva <ErezGeva2@gmail.com> */
3
13#ifndef __PTPMGMT_NAME_H
14#define __PTPMGMT_NAME_H
15
18#ifdef __cplusplus
19/* system headers used by all modules */
20#include <string>
21#include <cstdint>
22#include <cstring>
23#include <cstdio>
24
25#ifndef __PTPMGMT_NAMESPACE_BEGIN
27#define __PTPMGMT_NAMESPACE_BEGIN namespace ptpmgmt {
29#define __PTPMGMT_NAMESPACE_END };
30#endif /* __PTPMGMT_NAMESPACE_BEGIN */
31#if __cplusplus >= 201402L /* C++14 */
32#define __PTPMGMT_DEPRECATED(_func, _body) [[deprecated]] _func { _body; }
33#define __PTPMGMT_DEPRECATED_DEC(_func) [[deprecated]] _func
34#endif
35
36#else /* __cplusplus */
37
38#include <stdint.h>
39#include <string.h>
40#include <stdio.h>
41#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 202311L
42#include <stdbool.h>
43#endif
44
45#define __PTPMGMT_NAMESPACE_BEGIN
46#define __PTPMGMT_NAMESPACE_END
47
48#endif /* __cplusplus */
49
51#ifndef __PTPMGMT_DEPRECATED
52#ifdef __GNUC__
53#define __PTPMGMT_DEPRECATED(_func, _body)\
54 _func __attribute__ ((deprecated)) { _body; }
55#define __PTPMGMT_DEPRECATED_DEC(_func) _func __attribute__ ((deprecated))
56#elif defined(_MSC_VER)
57#define __PTPMGMT_DEPRECATED(_func, _body) __declspec(deprecated) _func { _body; }
58#define __PTPMGMT_DEPRECATED_DEC(_func) __declspec(deprecated) _func
59#else
60#define __PTPMGMT_DEPRECATED(_func, _body) _func { _body; }
61#define __PTPMGMT_DEPRECATED_DEC(_func) _func
62#endif
63#endif /* __PTPMGMT_DEPRECATED */
64
65/*
66 * POSIX and GNU probed headers and features
67 *
68 * The Open Group Base Specifications Issue 6
69 * IEEE Std 1003.1, 2004 Edition
70 * based url: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/
71 */
72
73/* Defined if we have the POSIX <unistd.h> header.
74 * Standard symbolic constants and types.
75 * url: <base>/unistd.h.html
76 */
77#define __PTPMGMT_HAVE_UNISTD_H 1
78
79/* Defined if we have the POSIX <sys/types.h> header.
80 * Data types.
81 * url: <base>/sys/types.h.html
82 */
83#define __PTPMGMT_HAVE_SYS_TYPES_H 1
84
85/* Defined if we have the POSIX <sys/un.h> header.
86 * Definitions for UNIX domain sockets.
87 * url: <base>/sys/un.h.html
88 */
89#define __PTPMGMT_HAVE_SYS_UN_H 1
90
91/* Defined if we have the POSIX <netinet/in.h> header.
92 * Internet address family.
93 * url: <base>/netinet/in.h.html
94 */
95#define __PTPMGMT_HAVE_NETINET_IN_H 1
96
97/* Defined if we have the GNU <getopt.h> header.
98 * GNU-style long options getopt.
99 */
100#define __PTPMGMT_HAVE_GETOPT_H 1
101
104#endif /* __PTPMGMT_NAME_H */