Fix link problems
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@24 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
1de7dd2cf2
commit
3a4de8b8a8
@ -60,9 +60,6 @@ OBJDUMP = $(CROSSDEV)objdump
|
|||||||
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
||||||
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
|
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
|
||||||
|
|
||||||
LDFLAGS = $(ARCHSCRIPT)
|
|
||||||
EXTRA_LIBS =
|
|
||||||
|
|
||||||
OBJEXT = .o
|
OBJEXT = .o
|
||||||
LIBEXT = .a
|
LIBEXT = .a
|
||||||
|
|
||||||
|
@ -56,6 +56,9 @@ COBJS = $(CSRCS:.c=.o)
|
|||||||
SRCS = $(ASRCS) $(CSRCS)
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
OBJS = $(AOBJS) $(COBJS)
|
OBJS = $(AOBJS) $(COBJS)
|
||||||
|
|
||||||
|
LDFLAGS = $(ARCHSCRIPT)
|
||||||
|
EXTRA_LIBS =
|
||||||
|
|
||||||
LINKOBJS =
|
LINKOBJS =
|
||||||
LINKLIBS =
|
LINKLIBS =
|
||||||
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
||||||
|
@ -59,9 +59,6 @@ OBJDUMP = $(CROSSDEV)objdump
|
|||||||
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
||||||
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
|
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
|
||||||
|
|
||||||
LDFLAGS = $(ARCHSCRIPT)
|
|
||||||
EXTRA_LIBS = -lc
|
|
||||||
|
|
||||||
OBJEXT = .o
|
OBJEXT = .o
|
||||||
LIBEXT = .a
|
LIBEXT = .a
|
||||||
|
|
||||||
|
@ -51,6 +51,9 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
|
|||||||
SRCS = $(ASRCS) $(CSRCS)
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
OBJS = $(AOBJS) $(COBJS)
|
OBJS = $(AOBJS) $(COBJS)
|
||||||
|
|
||||||
|
LDFLAGS = $(ARCHSCRIPT)
|
||||||
|
EXTRA_LIBS = -lc
|
||||||
|
|
||||||
LINKOBJS =
|
LINKOBJS =
|
||||||
LINKLIBS =
|
LINKLIBS =
|
||||||
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
||||||
|
@ -53,7 +53,7 @@ all: $(BIN)
|
|||||||
$(AOBJS): %$(OBJEXT): %.S
|
$(AOBJS): %$(OBJEXT): %.S
|
||||||
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
||||||
|
|
||||||
$(cOBJS): %$(OBJEXT): %.c
|
$(COBJS): %$(OBJEXT): %.c
|
||||||
$(CC) -c $(CFLAGS) $< -o $@
|
$(CC) -c $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
$(BIN): $(OBJS)
|
$(BIN): $(OBJS)
|
||||||
|
@ -54,7 +54,7 @@ all: $(BIN)
|
|||||||
$(AOBJS): %$(OBJEXT): %.S
|
$(AOBJS): %$(OBJEXT): %.S
|
||||||
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
||||||
|
|
||||||
$(cOBJS): %$(OBJEXT): %.c
|
$(COBJS): %$(OBJEXT): %.c
|
||||||
$(CC) -c $(CFLAGS) $< -o $@
|
$(CC) -c $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
$(BIN): $(OBJS)
|
$(BIN): $(OBJS)
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@ -74,50 +75,61 @@
|
|||||||
|
|
||||||
double_t rint(double_t x)
|
double_t rint(double_t x)
|
||||||
{
|
{
|
||||||
double_t retValue;
|
double_t ret;
|
||||||
|
|
||||||
/* If the current rounding mode rounds toward negative
|
/* If the current rounding mode rounds toward negative
|
||||||
* infinity, rint() is identical to floor(). If the current
|
* infinity, rint() is identical to floor(). If the current
|
||||||
* rounding mode rounds toward positive infinity, rint() is
|
* rounding mode rounds toward positive infinity, rint() is
|
||||||
* identical to ceil(). */
|
* identical to ceil().
|
||||||
#if ((defined(FP_ROUND_POSITIVE)) && (FP_ROUNDING_POSITIVE != 0))
|
*/
|
||||||
retValue = ceil(x);
|
|
||||||
|
|
||||||
#elif ((defined(FP_ROUND_NEGATIVE)) && (FP_ROUNDING_NEGATIVE != 0))
|
#if defined(CONFIG_FP_ROUND_POSITIVE) && CONFIG_FP_ROUNDING_POSITIVE != 0
|
||||||
retValue = floor(x);
|
|
||||||
|
ret = ceil(x);
|
||||||
|
|
||||||
|
#elif defined(CONFIG_FP_ROUND_NEGATIVE) && CONFIG_FP_ROUNDING_NEGATIVE != 0
|
||||||
|
|
||||||
|
ret = floor(x);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* In the default rounding mode (round to nearest), rint(x) is the
|
/* In the default rounding mode (round to nearest), rint(x) is the
|
||||||
* integer nearest x with the additional stipulation that if
|
* integer nearest x with the additional stipulation that if
|
||||||
* |rint(x)-x|=1/2, then rint(x) is even. */
|
* |rint(x)-x|=1/2, then rint(x) is even.
|
||||||
|
*/
|
||||||
|
|
||||||
long dwInteger = (long)x;
|
long dwinteger = (long)x;
|
||||||
double_t fRemainder = x - (double_t)dwInteger;
|
double_t fremainder = x - (double_t)dwinteger;
|
||||||
|
|
||||||
if (x < 0.0) {
|
if (x < 0.0)
|
||||||
|
{
|
||||||
|
/* fremainder should be in range 0 .. -1 */
|
||||||
|
|
||||||
/* fRemainder should be in range 0 .. -1 */
|
if (fremainder == -0.5)
|
||||||
if (fRemainder == -0.5)
|
{
|
||||||
dwInteger = ((dwInteger+1)&~1);
|
dwinteger = ((dwinteger+1)&~1);
|
||||||
else if (fRemainder < -0.5) {
|
}
|
||||||
dwInteger--;
|
else if (fremainder < -0.5)
|
||||||
|
{
|
||||||
|
dwinteger--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* fremainder should be in range 0 .. 1 */
|
||||||
|
|
||||||
} /* end if */
|
if (fremainder == 0.5)
|
||||||
} /* end if */
|
{
|
||||||
else {
|
dwinteger = ((dwinteger+1)&~1);
|
||||||
|
}
|
||||||
|
else if (fremainder > 0.5)
|
||||||
|
{
|
||||||
|
dwinteger++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* fRemainder should be in range 0 .. 1 */
|
ret = (double_t)dwinteger;
|
||||||
if (fRemainder == 0.5)
|
|
||||||
dwInteger = ((dwInteger+1)&~1);
|
|
||||||
else if (fRemainder > 0.5) {
|
|
||||||
dwInteger++;
|
|
||||||
|
|
||||||
} /* end if */
|
|
||||||
} /* end else */
|
|
||||||
|
|
||||||
retValue = (double_t)dwInteger;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return retValue;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user