Navigation


Changeset 1418:a51f71694121 in freeDiameter for extensions


Ignore:
Timestamp:
Feb 18, 2020, 6:58:20 PM (4 years ago)
Author:
Luke Mewburn <luke@mewburn.net>
Branch:
default
Phase:
public
committer:
Luke Mewburn <luke@mewburn.net> 1582020006 -39600
Message:

fix build with MySQL >= 8.0

MySQL 8.0 deprecated my_bool in favour of C99's bool.
Detect if my_bool is available, and if not, provide
a replacement.

Location:
extensions/app_diameap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_diameap/CMakeLists.txt

    r847 r1418  
    11# The Diameter EAP Application extension
    22PROJECT("Diameter EAP Application extension" C)
     3
     4INCLUDE (CheckCSourceCompiles)
    35
    46# Find MySQL
     
    68FIND_PACKAGE(Gcrypt REQUIRED)
    79INCLUDE_DIRECTORIES(${MySQL_INCLUDE_DIR})
     10
     11# Check for my_bool, deprecated in MySQL 8.0
     12SET(CHECK_MYSQL_MY_BOOL "
     13#include <mysql.h>
     14int main() {
     15my_bool f;
     16}")
     17SET(CMAKE_REQUIRED_INCLUDES ${MySQL_INCLUDE_DIR})
     18SET(CMAKE_REQUIRED_LIBRARIES ${MySQL_LIBRARY})
     19CHECK_C_SOURCE_COMPILES("${CHECK_MYSQL_MY_BOOL}" HAVE_MYSQL_MY_BOOL)
     20IF (HAVE_MYSQL_MY_BOOL)
     21  ADD_DEFINITIONS(-DHAVE_MYSQL_MY_BOOL)
     22ENDIF()
    823
    924# Parse plugins
  • extensions/app_diameap/diameap_init.c

    r974 r1418  
    3838
    3939#include "diameap_common.h"
     40
     41#ifndef HAVE_MYSQL_MY_BOOL
     42#include <stdbool.h>
     43typedef bool my_bool;
     44#endif /* HAVE_MYSQL_MY_BOOL */
    4045
    4146/* Dictionary Object templates */
Note: See TracChangeset for help on using the changeset viewer.