Skip to content

Commit

Permalink
Fix bug while parsing fenv_constants.h
Browse files Browse the repository at this point in the history
  • Loading branch information
andrioni committed Aug 27, 2013
1 parent 4f6ee0f commit 454f61a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ errno_h.jl:
@$(PRINT_PERL) echo '#include "errno.h"' | $(CPP) -dM - | perl -nle 'print "const $$1 = int32($$2)" if /^#define\s+(E\w+)\s+(\d+)\s*$$/' | sort > $@

fenv_constants.jl: ../src/fenv_constants.h
$(QUIET_PERL) ${CC} -E -P -DJULIA ../src/fenv_constants.h | perl -nle 'print "$$1 0o$$2" if /^(\s*const\s+[A-z_]+\s+=)\s+(0[0-9]*)\s*$$/; print "$$1" if /^\s*(const\s+[A-z_]+\s+=\s+([1-9]|0x)[0-9A-z]*)\s*$$/' > $@
$(QUIET_PERL) ${CC} -E -P -DJULIA ../src/fenv_constants.h | tail -n 8 > $@

file_constants.jl: ../src/file_constants.h
@$(PRINT_PERL) $(CPP) -P -DJULIA ../src/file_constants.h | perl -nle 'print "$$1 0o$$2" if /^(\s*const\s+[A-z_]+\s+=)\s+(0[0-9]*)\s*$$/; print "$$1" if /^\s*(const\s+[A-z_]+\s+=\s+([1-9]|0x)[0-9A-z]*)\s*$$/' > $@
Expand Down
6 changes: 5 additions & 1 deletion src/fenv_constants.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include <fenv.h>

const JL_FE_INEXACT = FE_INEXACT
const JL_FE_UNDERFLOW = FE_UNDERFLOW
const JL_FE_OVERFLOW = FE_OVERFLOW
const JL_FE_DIVBYZERO = FE_DIVBYZERO
const JL_FE_INVALID = FE_INVALID
const JL_FE_TONEAREST = FE_TONEAREST
const JL_FE_UPWARD = FE_UPWARD
const JL_FE_DOWNWARD = FE_DOWNWARD
Expand Down

0 comments on commit 454f61a

Please sign in to comment.