mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-06 01:26:49 +08:00
[osal]: match system implementation with compiler marco
It would make the build system more simple, and the cross toolchains would do the rest to you. Toolchains like buildroot default not enable the __gnu_linux__ marco in the pre-processor will surfure from the systsm unknown problem. You should enable the marco in building toolchains or have a look on those scripts in build directory. Change-Id: I8f6af3391aa3d94d602ec8d84ba5e43839859169 Signed-off-by: Randy Li <randy.li@rock-chips.com>
This commit is contained in:
@@ -9,4 +9,4 @@ SET(CMAKE_SYSTEM_PROCESSOR "armv8")
|
|||||||
|
|
||||||
add_definitions(-fPIC)
|
add_definitions(-fPIC)
|
||||||
add_definitions(-DARMLINUX)
|
add_definitions(-DARMLINUX)
|
||||||
|
add_definitions(-D__gnu_linux__)
|
||||||
|
@@ -9,4 +9,4 @@ SET(CMAKE_SYSTEM_PROCESSOR "armv7-a_hardfp")
|
|||||||
|
|
||||||
add_definitions(-fPIC)
|
add_definitions(-fPIC)
|
||||||
add_definitions(-DARMLINUX)
|
add_definitions(-DARMLINUX)
|
||||||
|
add_definitions(-D__gnu_linux__)
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__ANDROID__)
|
||||||
#include "allocator_std.h"
|
#include "allocator_std.h"
|
||||||
#include "allocator_ion.h"
|
#include "allocator_ion.h"
|
||||||
#include "allocator_drm.h"
|
#include "allocator_drm.h"
|
||||||
@@ -47,4 +48,4 @@ MPP_RET os_allocator_get(os_allocator *api, MppBufferType type)
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__ANDROID__)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -74,4 +75,4 @@ RK_S32 os_set_env_str(const char *name, char *value)
|
|||||||
return (len) ? (0) : (-1);
|
return (len) ? (0) : (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__ANDROID__)
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
|
|
||||||
void os_log(const char* tag, const char* msg, va_list list)
|
void os_log(const char* tag, const char* msg, va_list list)
|
||||||
@@ -25,4 +26,4 @@ void os_err(const char* tag, const char* msg, va_list list)
|
|||||||
{
|
{
|
||||||
__android_log_vprint(ANDROID_LOG_ERROR, tag, msg, list);
|
__android_log_vprint(ANDROID_LOG_ERROR, tag, msg, list);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__ANDROID__)
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "os_mem.h"
|
#include "os_mem.h"
|
||||||
|
|
||||||
@@ -45,4 +46,4 @@ void os_free(void *ptr)
|
|||||||
{
|
{
|
||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__gnu_linux__)
|
||||||
#include "mpp_log.h"
|
#include "mpp_log.h"
|
||||||
|
|
||||||
#include "allocator_std.h"
|
#include "allocator_std.h"
|
||||||
@@ -57,3 +58,4 @@ MPP_RET os_allocator_get(os_allocator *api, MppBufferType type)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__gnu_linux__)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -60,4 +61,4 @@ RK_S32 os_set_env_str(const char *name, char *value)
|
|||||||
return setenv(name, value, 1);
|
return setenv(name, value, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__gnu_linux__)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "os_log.h"
|
#include "os_log.h"
|
||||||
@@ -34,3 +35,4 @@ void os_err(const char* tag, const char* msg, va_list list)
|
|||||||
vfprintf(stderr, line, list);
|
vfprintf(stderr, line, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__gnu_linux__)
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "os_mem.h"
|
#include "os_mem.h"
|
||||||
|
|
||||||
@@ -34,3 +35,4 @@ void os_free(void *ptr)
|
|||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
#include "os_allocator.h"
|
#include "os_allocator.h"
|
||||||
#include "allocator_std.h"
|
#include "allocator_std.h"
|
||||||
|
|
||||||
@@ -37,3 +38,4 @@ MPP_RET os_allocator_get(os_allocator *api, MppBufferType type)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "os_env.h"
|
#include "os_env.h"
|
||||||
@@ -61,4 +62,4 @@ RK_S32 os_set_env_str(const char *name, char *value)
|
|||||||
return _putenv(buf);
|
return _putenv(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
@@ -33,3 +34,4 @@ void os_err(const char* tag, const char* msg, va_list list)
|
|||||||
vfprintf(stderr, line, list);
|
vfprintf(stderr, line, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include "os_mem.h"
|
#include "os_mem.h"
|
||||||
|
|
||||||
@@ -34,3 +35,4 @@ void os_free(void *ptr)
|
|||||||
_aligned_free(ptr);
|
_aligned_free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
#if defined(_WIN32)
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/* a minimal set of C99 types for use with MSVC */
|
/* a minimal set of C99 types for use with MSVC */
|
||||||
@@ -11,3 +12,5 @@ typedef unsigned char uint8_t;
|
|||||||
typedef unsigned short int uint16_t;
|
typedef unsigned short int uint16_t;
|
||||||
typedef unsigned int uint32_t;
|
typedef unsigned int uint32_t;
|
||||||
typedef unsigned __int64 uint64_t;
|
typedef unsigned __int64 uint64_t;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
Reference in New Issue
Block a user