Fix compile errors with musl

Tested on RK3588 EVB with musl-1.2.2 and gcc-10.2.

Change-Id: I10574446f46964bad5e67ab45c76060a193b8335
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
This commit is contained in:
Jeffy Chen
2022-05-26 09:05:28 +08:00
committed by Herman Chen
parent 5dccad43d4
commit 0f0d28c2ec
7 changed files with 9 additions and 8 deletions

View File

@@ -9,4 +9,4 @@ SET(CMAKE_SYSTEM_PROCESSOR "armv8-a")
add_definitions(-fPIC) add_definitions(-fPIC)
add_definitions(-DARMLINUX) add_definitions(-DARMLINUX)
add_definitions(-D__gnu_linux__) add_definitions(-Dlinux)

View File

@@ -9,4 +9,4 @@ SET(CMAKE_SYSTEM_PROCESSOR "armv7-a")
add_definitions(-fPIC) add_definitions(-fPIC)
add_definitions(-DARMLINUX) add_definitions(-DARMLINUX)
add_definitions(-D__gnu_linux__) add_definitions(-Dlinux)

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#if defined(__gnu_linux__) #if defined(linux) && !defined(__ANDROID__)
#include "mpp_log.h" #include "mpp_log.h"
#include "mpp_runtime.h" #include "mpp_runtime.h"

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#if defined(__gnu_linux__) #if defined(linux) && !defined(__ANDROID__)
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#if defined(__gnu_linux__) #if defined(linux) && !defined(__ANDROID__)
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <syslog.h> #include <syslog.h>

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#if defined(__gnu_linux__) #if defined(linux) && !defined(__ANDROID__)
#include <stdlib.h> #include <stdlib.h>
#include "os_mem.h" #include "os_mem.h"

View File

@@ -17,6 +17,7 @@
#define MODULE_TAG "utils" #define MODULE_TAG "utils"
#include <ctype.h> #include <ctype.h>
#include <limits.h>
#include <string.h> #include <string.h>
#include "mpp_mem.h" #include "mpp_mem.h"
@@ -196,10 +197,10 @@ void wide_bit_sum(RK_U8 *data, RK_U32 len, RK_ULONG *sum)
RK_U8 *data8 = NULL; RK_U8 *data8 = NULL;
RK_U32 loop; RK_U32 loop;
data8 = data; data8 = data;
#if __WORDSIZE == 32 #if LONG_MAX == INT_MAX
RK_U16 *data_rk = NULL; RK_U16 *data_rk = NULL;
data_rk = (RK_U16 *)data; data_rk = (RK_U16 *)data;
#elif __WORDSIZE == 64 #else
RK_U32 *data_rk = NULL; RK_U32 *data_rk = NULL;
data_rk = (RK_U32 *)data; data_rk = (RK_U32 *)data;
#endif #endif