Skip to content

Commit

Permalink
Fixup build on modern GCC
Browse files Browse the repository at this point in the history
Closes #26, this is the rebased and newer version.

Co-authored-by: Dom Rodriguez <shymega@shymega.org.uk>
  • Loading branch information
neochapay and shymega committed May 12, 2024
1 parent 0751b1c commit 4204936
Show file tree
Hide file tree
Showing 26 changed files with 121 additions and 1 deletion.
2 changes: 2 additions & 0 deletions apps/audioplayers/a2dp_decoder/a2dp_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*
****************************************************************************/
// Standard C Included Files
#define __STDC_LIMIT_MACROS
#include <stdint.h>
#include "a2dp_decoder.h"
#include "a2dp_decoder_internal.h"
#include "app_audio.h"
Expand Down
5 changes: 5 additions & 0 deletions apps/audioplayers/a2dp_decoder/a2dp_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
//#define A2DP_DECODER_HISTORY_LOCTIME_SAVE (1)
//#define A2DP_DECODER_HISTORY_CHECK_SUM_SAVE (1)

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

typedef uint16_t A2DP_AUDIO_CODEC_TYPE;

#define A2DP_AUDIO_CODEC_TYPE_SBC (1u<<0)
Expand Down
2 changes: 2 additions & 0 deletions apps/audioplayers/a2dp_decoder/a2dp_decoder_aac_lc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*
****************************************************************************/
// Standard C Included Files
#define __STDC_LIMIT_MACROS
#include <stdint.h>
#include "a2dp_decoder_internal.h"
#include "cmsis.h"
#include "cmsis_os.h"
Expand Down
2 changes: 2 additions & 0 deletions apps/audioplayers/a2dp_decoder/a2dp_decoder_sbc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*
****************************************************************************/
// Standard C Included Files
#define __STDC_LIMIT_MACROS
#include <stdint.h>
#include "a2dp_decoder_internal.h"
#include "cmsis.h"
#include "cmsis_os.h"
Expand Down
5 changes: 5 additions & 0 deletions apps/audioplayers/plc_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
#include <stdint.h>
#include <stdbool.h>

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

typedef enum plc_type
{
PLC_TYPE_PASS = 0,
Expand Down
3 changes: 3 additions & 0 deletions apps/common/app_spec_ostimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
* trademark and other intellectual property rights.
*
****************************************************************************/
#define __STDC_LIMIT_MACROS
#include <stdint.h>

#include "app_spec_ostimer.h"
#include "cmsis_os.h"
#include "hal_trace.h"
Expand Down
5 changes: 5 additions & 0 deletions include/rtos/rtx/cmsis_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ extern "C"
{
#endif

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

#include "os_tcb.h"

// ==== Enumeration, structures, defines ====
Expand Down
6 changes: 5 additions & 1 deletion platform/cmsis/inc/arm_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,14 @@
* @defgroup groupExamples Examples
*/


#ifndef _ARM_MATH_H
#define _ARM_MATH_H

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

/* Compiler specific diagnostic adjustment */
#if defined ( __CC_ARM )

Expand Down
7 changes: 7 additions & 0 deletions platform/cmsis/inc/core_cm4.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,19 @@

#ifndef __ASSEMBLER__
#include <stdint.h>

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

#endif

#ifdef __cplusplus
extern "C" {
#endif


/**
\page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
CMSIS violates the following MISRA-C:2004 rules:
Expand Down
5 changes: 5 additions & 0 deletions platform/cmsis/inc/mpu_armv7.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
* limitations under the License.
*/

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

#if defined ( __ICCARM__ )
#pragma system_include /* treat file as system include file for MISRA check */
#elif defined (__clang__)
Expand Down
5 changes: 5 additions & 0 deletions platform/hal/best2300p/hal_cmu_best2300p.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
extern "C" {
#endif

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

#define HAL_CMU_VALID_CRYSTAL_FREQ { 26000000, 24000000, 40000000, 48000000, }

enum HAL_CMU_MOD_ID_T {
Expand Down
5 changes: 5 additions & 0 deletions platform/hal/hal_aud.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ extern "C" {

#include <stdint.h>

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

#define CODEC_FREQ_24M 24000000
#define CODEC_FREQ_26M 26000000
#define CODEC_FREQ_24P576M 24576000
Expand Down
5 changes: 5 additions & 0 deletions platform/hal/hal_cmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ extern "C" {
#include "stdint.h"
#include CHIP_SPECIFIC_HDR(hal_cmu)

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

#ifndef HAL_CMU_DEFAULT_CRYSTAL_FREQ
#define HAL_CMU_DEFAULT_CRYSTAL_FREQ 26000000
#endif
Expand Down
5 changes: 5 additions & 0 deletions platform/hal/hal_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ extern "C" {
// For 10-bit address devices: OR the following mask with the real address
#define HAL_I2C_10BITADDR_MASK (1 << 15)

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

enum HAL_I2C_ACTION_AFTER_WRITE_T {
HAL_I2C_STOP_AFTER_WRITE = 0,
HAL_I2C_RESTART_AFTER_WRITE,
Expand Down
5 changes: 5 additions & 0 deletions platform/hal/hal_norflash.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
extern "C" {
#endif

#ifndef __uint32_t_defined
typedef unsigned int int32_t;
#define __uint32_t_defined
#endif

#include "plat_types.h"
#include "hal_cmu.h"

Expand Down
5 changes: 5 additions & 0 deletions platform/hal/hal_sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
extern "C" {
#endif

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

#include "plat_types.h"

enum HAL_CPU_WAKE_LOCK_USER_T {
Expand Down
5 changes: 5 additions & 0 deletions platform/hal/hal_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
extern "C" {
#endif

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

#include "hal_cmu.h"
#include "plat_types.h"

Expand Down
5 changes: 5 additions & 0 deletions platform/hal/hal_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
extern "C" {
#endif

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

#include "hal_trace_mod.h"
#include "plat_types.h"

Expand Down
5 changes: 5 additions & 0 deletions platform/hal/hal_uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ extern "C" {

#ifdef CHIP_HAS_UART

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

#include "plat_types.h"
#include "stdbool.h"
#include "stdint.h"
Expand Down
5 changes: 5 additions & 0 deletions platform/hal/plat_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ extern "C" {
#include "stdint.h"
#include "stdbool.h"

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned long u32;
Expand Down
5 changes: 5 additions & 0 deletions services/bt_app/app_bt.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ extern "C" {
#include "a2dp_api.h"
#include "hfp_api.h"

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

enum APP_BT_REQ_T {
APP_BT_REQ_ACCESS_MODE_SET,
APP_BT_REQ_AUTO_TEST,
Expand Down
5 changes: 5 additions & 0 deletions services/bt_app/audio_prompt_sbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ extern "C" {
#define PENDING_TO_STOP_SCO_STREAMING 1
#define PENDING_TO_STOP_STREAM_INVALID (0xFF)

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

typedef struct
{
uint8_t channelCnt;
Expand Down
5 changes: 5 additions & 0 deletions services/bt_if_enhanced/inc/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
extern "C" {
#endif

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

#ifndef BOOL_DEFINED
typedef unsigned int BOOL; /* IGNORESTYLE */
#endif
Expand Down
5 changes: 5 additions & 0 deletions services/bt_if_enhanced/inc/me_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@

typedef uint8_t btif_event_type_t;

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

#if defined(BTIF_HCI_HOST_FLOW_CONTROL) && defined(__IAG_BLE_INCLUDE__)
#define BTIF_BTEVENT_CONNECT_CPMPLETE 1
#endif /* */
Expand Down
5 changes: 5 additions & 0 deletions utils/boot_struct/reboot_param.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ extern "C" {

#include "stdint.h"

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

struct REBOOT_PARAM_T {
uint32_t reserved[4];
};
Expand Down
5 changes: 5 additions & 0 deletions utils/heap/heap_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
extern "C" {
#endif

#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
#define __uint32_t_defined
#endif

#define SYSPOOL_PURE __attribute__((__const__))

void syspool_init(void);
Expand Down

0 comments on commit 4204936

Please sign in to comment.