spinel: Add definitions for __BEGIN_DECLS and __END_DECLS (#172)

Sometimes platforms don't provide definitions for `__BEGIN_DECLS` and `__END_DECLS`.
This commit is contained in:
Robert Quattlebaum
2016-06-17 20:20:19 -07:00
committed by Jonathan Hui
parent 6889db695e
commit db3ead3577
+15 -3
View File
@@ -34,16 +34,26 @@
#include <stdint.h>
#include <sys/types.h>
__BEGIN_DECLS
// ----------------------------------------------------------------------------
#ifndef DOXYGEN_SHOULD_SKIP_THIS
# if defined(__GNUC__) && !SPINEL_EMBEDDED
# if defined(__GNUC__)
# define SPINEL_API_EXTERN extern __attribute__ ((visibility ("default")))
# define SPINEL_API_NONNULL_ALL __attribute__((nonnull))
# define SPINEL_API_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
# endif // ifdef __GNUC__
# if !defined(__BEGIN_DECLS) || !defined(__END_DECLS)
# if defined(__cplusplus)
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
# else // if defined(__cplusplus)
# define __BEGIN_DECLS
# define __END_DECLS
# endif // else defined(__cplusplus)
# endif // if !defined(__BEGIN_DECLS) || !defined(__END_DECLS)
#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS
#ifndef SPINEL_API_EXTERN
@@ -67,6 +77,8 @@ __BEGIN_DECLS
// ----------------------------------------------------------------------------
__BEGIN_DECLS
typedef enum
{
SPINEL_STATUS_OK = 0, ///< Operation has completed successfully.