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) \
|
||||
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
|
||||
|
||||
LDFLAGS = $(ARCHSCRIPT)
|
||||
EXTRA_LIBS =
|
||||
|
||||
OBJEXT = .o
|
||||
LIBEXT = .a
|
||||
|
||||
|
@ -56,6 +56,9 @@ COBJS = $(CSRCS:.c=.o)
|
||||
SRCS = $(ASRCS) $(CSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS)
|
||||
|
||||
LDFLAGS = $(ARCHSCRIPT)
|
||||
EXTRA_LIBS =
|
||||
|
||||
LINKOBJS =
|
||||
LINKLIBS =
|
||||
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
||||
|
@ -59,9 +59,6 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
||||
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
|
||||
|
||||
LDFLAGS = $(ARCHSCRIPT)
|
||||
EXTRA_LIBS = -lc
|
||||
|
||||
OBJEXT = .o
|
||||
LIBEXT = .a
|
||||
|
||||
|
@ -51,6 +51,9 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
SRCS = $(ASRCS) $(CSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS)
|
||||
|
||||
LDFLAGS = $(ARCHSCRIPT)
|
||||
EXTRA_LIBS = -lc
|
||||
|
||||
LINKOBJS =
|
||||
LINKLIBS =
|
||||
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
||||
|
@ -53,7 +53,7 @@ all: $(BIN)
|
||||
$(AOBJS): %$(OBJEXT): %.S
|
||||
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
||||
|
||||
$(cOBJS): %$(OBJEXT): %.c
|
||||
$(COBJS): %$(OBJEXT): %.c
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
$(BIN): $(OBJS)
|
||||
|
@ -54,7 +54,7 @@ all: $(BIN)
|
||||
$(AOBJS): %$(OBJEXT): %.S
|
||||
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
||||
|
||||
$(cOBJS): %$(OBJEXT): %.c
|
||||
$(COBJS): %$(OBJEXT): %.c
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
$(BIN): $(OBJS)
|
||||
|
@ -41,6 +41,7 @@
|
||||
* Included Files
|
||||
************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -74,50 +75,61 @@
|
||||
|
||||
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
|
||||
* rounding mode rounds toward positive infinity, rint() is
|
||||
* identical to ceil(). */
|
||||
#if ((defined(FP_ROUND_POSITIVE)) && (FP_ROUNDING_POSITIVE != 0))
|
||||
retValue = ceil(x);
|
||||
* identical to ceil().
|
||||
*/
|
||||
|
||||
#elif ((defined(FP_ROUND_NEGATIVE)) && (FP_ROUNDING_NEGATIVE != 0))
|
||||
retValue = floor(x);
|
||||
#if defined(CONFIG_FP_ROUND_POSITIVE) && CONFIG_FP_ROUNDING_POSITIVE != 0
|
||||
|
||||
ret = ceil(x);
|
||||
|
||||
#elif defined(CONFIG_FP_ROUND_NEGATIVE) && CONFIG_FP_ROUNDING_NEGATIVE != 0
|
||||
|
||||
ret = floor(x);
|
||||
|
||||
#else
|
||||
|
||||
/* In the default rounding mode (round to nearest), rint(x) is the
|
||||
* 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;
|
||||
double_t fRemainder = x - (double_t)dwInteger;
|
||||
long dwinteger = (long)x;
|
||||
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)
|
||||
dwInteger = ((dwInteger+1)&~1);
|
||||
else if (fRemainder < -0.5) {
|
||||
dwInteger--;
|
||||
if (fremainder == -0.5)
|
||||
{
|
||||
dwinteger = ((dwinteger+1)&~1);
|
||||
}
|
||||
else if (fremainder < -0.5)
|
||||
{
|
||||
dwinteger--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* fremainder should be in range 0 .. 1 */
|
||||
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
else {
|
||||
if (fremainder == 0.5)
|
||||
{
|
||||
dwinteger = ((dwinteger+1)&~1);
|
||||
}
|
||||
else if (fremainder > 0.5)
|
||||
{
|
||||
dwinteger++;
|
||||
}
|
||||
}
|
||||
|
||||
/* fRemainder should be in range 0 .. 1 */
|
||||
if (fRemainder == 0.5)
|
||||
dwInteger = ((dwInteger+1)&~1);
|
||||
else if (fRemainder > 0.5) {
|
||||
dwInteger++;
|
||||
|
||||
} /* end if */
|
||||
} /* end else */
|
||||
|
||||
retValue = (double_t)dwInteger;
|
||||
ret = (double_t)dwinteger;
|
||||
#endif
|
||||
|
||||
return retValue;
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user