Files
libcoap/include/coap3/coap_libcoap_build.h
T
Jon Shallow d2d4a81374 locking: Simplify maintenance / debugging /documentation
Update the Public API equivalent of the libcoap functions that need to be
called when locked with a name suffix of _lkd.

Move matching Public API functions out of coap_threadsafe.c to be coded
just ahead of the newly renamed _lkd function.

Properly define the _lkd function in the appropriate _internal.h file for
documentation, removing the #defines from coap_threadsafe_internal.h.

Tag all the Public API functions that have a _lkd function with COAP_API.
COAP_API can then be defined as to what should be done for that function.

Check libcoap library does not call the original Public API function when
it should be calling the _lkd function by marking the Public API not _lkd
functions as deprecated during the libcoap library build.
[Done by the new COAP_API being defined as __attribute__((deprecated)).]

Work in progress for all the functions that need to be multi-thread safe.
2024-05-21 14:51:51 +01:00

48 lines
1.2 KiB
C

/*
* coap_libcoap_build.h -- libcoap library build specifics
*
* Copyright (C) 2019-2024 Jon Shallow <supjps-libcoap@jpshallow.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*
* This file is part of the CoAP library libcoap. Please see README for terms
* of use.
*/
/*
* All libcoap library files should include this file which then pulls in all
* of the other appropriate header files.
*
* Here can be added in specific checks to make sure that the libcoap library
* is built as expected.
*
* Note: This file should never be included in application code.
*/
/**
* @file coap_libcoap_build.h
* @brief Library specific build wrapper for coap_internal.h
*/
#ifndef COAP_LIBCOAP_BUILD_H_
#define COAP_LIBCOAP_BUILD_H_
#include "coap_config.h"
/*
* This is here to to catch any code within libcoap that is not
* calling the _lkd version of the Public API function when
* compiling. This is to try and catch all the locking dead-locks.
*/
#if !defined(COAP_API)
# ifdef __GNUC__
# define COAP_API __attribute__((deprecated))
# else /* __GNUC__ */
# define COAP_API
# endif /* __GNUC__ */
#endif
#include "coap_internal.h"
#endif /* COAP_LIBCOAP_BUILD_H_ */