cisco / libsrtp

Library for SRTP (Secure Realtime Transport Protocol)
Other
1.23k stars 476 forks source link

Fix build issues on STM32H7 with ARM GNU toolchain #719

Closed aggarg closed 4 months ago

aggarg commented 4 months ago

Description

I tried building the libstrp for STM32H743ZI (Cortex-M7) target using ARM GNU GCC and faced some build issues. This change fixes those issues.

  1. aes_gcm_mbedtls.c and aes_icm_mbedtls.c - Fix use for before declaration errors.
  2. datatypes.h - Do not generate error when HAVE_NETINET_IN_H and HAVE_WINSOCK2_H are not defined. This enables the library to be used on embedded targets using FreeRTOS-Plus-TCP.
  3. err.h and srtp.c - Allow the application to change the logging macro definitions at compile time. The application can provide these definitions in config.h.
pabuhler commented 4 months ago

I can understand 1 & 2, but why 3? You can install a handler for the debug, why do you need to replace at compile time.

aggarg commented 4 months ago

You can install a handler for the debug, why do you need to replace at compile time.

It is needed if I want to completely remove the debug logs to reduce code size. With this change I can add the following to config.h to remove logs -

#define debug_print0(mod, format)
#define debug_print(mod, format, arg)
#define debug_print2(mod, format, arg1, arg2)
aggarg commented 4 months ago

@pabuhler Do you need anything else to merge this?

aggarg commented 4 months ago

Would be happy to fix if and when that happens.