mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
Move include/nuttx/math.h to include/nuttx/lib/math.h
This commit is contained in:
@@ -339,10 +339,10 @@ config ARCH_MATH_H
|
|||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
There is also a re-directing version of math.h in the source tree.
|
There is also a re-directing version of math.h in the source tree.
|
||||||
However, it resides out-of-the-way at include/nuttx/math.h because it
|
However, it resides out-of-the-way at include/nuttx/lib/math.h because it
|
||||||
conflicts too often with the system math.h. If ARCH_MATH_H=y is
|
conflicts too often with the system math.h. If ARCH_MATH_H=y is
|
||||||
defined, however, the top-level makefile will copy the redirecting
|
defined, however, the top-level makefile will copy the redirecting
|
||||||
math.h header file from include/nuttx/math.h to include/math.h. math.h
|
math.h header file from include/nuttx/lib/math.h to include/math.h. math.h
|
||||||
will then include the architecture-specific version of math.h that you
|
will then include the architecture-specific version of math.h that you
|
||||||
must provide at nuttx/arch/>architecture</include/math.h.
|
must provide at nuttx/arch/>architecture</include/math.h.
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -183,16 +183,16 @@ BIN = nuttx$(EXEEXT)
|
|||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
.PHONY: context clean_context check_context export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
|
.PHONY: context clean_context check_context export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
|
||||||
|
|
||||||
# Target used to copy include/nuttx/math.h. If CONFIG_ARCH_MATH_H is
|
# Target used to copy include/nuttx/lib/math.h. If CONFIG_ARCH_MATH_H is
|
||||||
# defined, then there is an architecture specific math.h header file
|
# defined, then there is an architecture specific math.h header file
|
||||||
# that will be included indirectly from include/math.h. But first, we
|
# that will be included indirectly from include/math.h. But first, we
|
||||||
# have to copy math.h from include/nuttx/. to include/. Logic within
|
# have to copy math.h from include/nuttx/. to include/. Logic within
|
||||||
# include/nuttx/math.h will hand the redirection to the architecture-
|
# include/nuttx/lib/math.h will hand the redirection to the architecture-
|
||||||
# specific math.h header file.
|
# specific math.h header file.
|
||||||
#
|
#
|
||||||
# If the CONFIG_LIBM is defined, the Rhombus libm will be built at libc/math.
|
# If the CONFIG_LIBM is defined, the Rhombus libm will be built at libc/math.
|
||||||
# Definitions and prototypes for the Rhombus libm are also contained in
|
# Definitions and prototypes for the Rhombus libm are also contained in
|
||||||
# include/nuttx/math.h and so the file must also be copied in that case.
|
# include/nuttx/lib/math.h and so the file must also be copied in that case.
|
||||||
#
|
#
|
||||||
# If neither CONFIG_ARCH_MATH_H nor CONFIG_LIBM is defined, then no math.h
|
# If neither CONFIG_ARCH_MATH_H nor CONFIG_LIBM is defined, then no math.h
|
||||||
# header file will be provided. You would want that behavior if (1) you
|
# header file will be provided. You would want that behavior if (1) you
|
||||||
@@ -208,8 +208,8 @@ endif
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(NEED_MATH_H),y)
|
ifeq ($(NEED_MATH_H),y)
|
||||||
include/math.h: include/nuttx/math.h
|
include/math.h: include/nuttx/lib/math.h
|
||||||
$(Q) cp -f include/nuttx/math.h include/math.h
|
$(Q) cp -f include/nuttx/lib/math.h include/math.h
|
||||||
else
|
else
|
||||||
include/math.h:
|
include/math.h:
|
||||||
endif
|
endif
|
||||||
|
|||||||
+2
-2
@@ -321,13 +321,13 @@ Notes about Header Files
|
|||||||
|
|
||||||
If you have a custom, architecture specific math.h header file, then
|
If you have a custom, architecture specific math.h header file, then
|
||||||
that header file should be placed at arch/<cpu>/include/math.h. There
|
that header file should be placed at arch/<cpu>/include/math.h. There
|
||||||
is a stub math.h header file located at include/nuttx/math.h. This stub
|
is a stub math.h header file located at include/nuttx/lib/math.h. This stub
|
||||||
header file can be used to "redirect" the inclusion to an architecture-
|
header file can be used to "redirect" the inclusion to an architecture-
|
||||||
specific math.h header file. If you add an architecture specific math.h
|
specific math.h header file. If you add an architecture specific math.h
|
||||||
header file then you should also define CONFIG_ARCH_MATH_H=y in your
|
header file then you should also define CONFIG_ARCH_MATH_H=y in your
|
||||||
NuttX Configuration file. If CONFIG_ARCH_MATH_H is selected, then the
|
NuttX Configuration file. If CONFIG_ARCH_MATH_H is selected, then the
|
||||||
top-level Makefile will copy the stub math.h header file from
|
top-level Makefile will copy the stub math.h header file from
|
||||||
include/nuttx/math.h to include/math.h where it will become the system
|
include/nuttx/lib/math.h to include/math.h where it will become the system
|
||||||
math.h header file. The stub math.h header file does nothing other
|
math.h header file. The stub math.h header file does nothing other
|
||||||
than to include that architecture-specific math.h header file as the
|
than to include that architecture-specific math.h header file as the
|
||||||
system math.h header file.
|
system math.h header file.
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
#include <nuttx/fs/ioctl.h>
|
#include <nuttx/fs/ioctl.h>
|
||||||
#include <nuttx/audio/audio.h>
|
#include <nuttx/audio/audio.h>
|
||||||
#include <nuttx/audio/vs1053.h>
|
#include <nuttx/audio/vs1053.h>
|
||||||
#include <nuttx/math.h>
|
#include <nuttx/lib/math.h>
|
||||||
|
|
||||||
#include "vs1053.h"
|
#include "vs1053.h"
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
#include <nuttx/audio/i2s.h>
|
#include <nuttx/audio/i2s.h>
|
||||||
#include <nuttx/audio/audio.h>
|
#include <nuttx/audio/audio.h>
|
||||||
#include <nuttx/audio/wm8904.h>
|
#include <nuttx/audio/wm8904.h>
|
||||||
#include <nuttx/math.h>
|
#include <nuttx/lib/math.h>
|
||||||
|
|
||||||
#include "wm8904.h"
|
#include "wm8904.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* include/nuttx/math.h
|
* include/nuttx/lib/math.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009, 2012, 2014-2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2009, 2012, 2014-2016 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __INCLUDE_NUTTX_MATH_H
|
#ifndef __INCLUDE_NUTTX_LIB_MATH_H
|
||||||
#define __INCLUDE_NUTTX_MATH_H
|
#define __INCLUDE_NUTTX_LIB_MATH_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@@ -406,4 +406,4 @@ long double truncl (long double x);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_LIBM */
|
#endif /* CONFIG_LIBM */
|
||||||
#endif /* __INCLUDE_NUTTX_MATH_H */
|
#endif /* __INCLUDE_NUTTX_LIB_MATH_H */
|
||||||
+3
-2
@@ -17,8 +17,9 @@ config LIBM
|
|||||||
|
|
||||||
Another possibility is that you have a custom, architecture-specific math
|
Another possibility is that you have a custom, architecture-specific math
|
||||||
libary and that the corresponding math.h file resides at arch/<architecture>/include/math.h.
|
libary and that the corresponding math.h file resides at arch/<architecture>/include/math.h.
|
||||||
The option is selected via ARCH_MATH_H. If ARCH_MATH_H is selected,then the include/nuttx/math.h
|
The option is selected via ARCH_MATH_H. If ARCH_MATH_H is selected,then the
|
||||||
header file will be copied to include/math.h where it can be used by your applications.
|
include/nuttx/libmath.h header file will be copied to include/math.h where it can
|
||||||
|
be used by your applications.
|
||||||
|
|
||||||
If ARCH_MATH_H is not defined, then this option can be selected to build a generic,
|
If ARCH_MATH_H is not defined, then this option can be selected to build a generic,
|
||||||
math library built into NuttX. This math library comes from the Rhombus OS and
|
math library built into NuttX. This math library comes from the Rhombus OS and
|
||||||
|
|||||||
Reference in New Issue
Block a user