git: math.h: Convert HUGE_VALL to constant, from const-qualified

看板DFBSD_commit作者時間15年前 (2010/07/01 16:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit d1c42bb23082b2a1c10016ee94c3f7cdb678a2e8 Author: Stathis Kamperis <beket@dragonflybsd.org> Date: Wed Jun 30 23:56:06 2010 +0300 math.h: Convert HUGE_VALL to constant, from const-qualified var Define HUGE_VALL via a compiler builtin. If the compiler doesn't support it, we just fallback to previous situation. Both gcc and clang play well with it. This patch allows us to: 1. use HUGE_VALL as initializer element for objects with static storage duration 2. not worry about the format of long double (e.g., 96bit vs 128bit) 3. not worry about things like endianness Briefly-discussed-with: corecode@, swildner@, but put the blame on me if I broke something for you. Special-thanks-to: swildner@ for checking code with clang. P.S. HUGE_VAL{,F} already do the right thing. Summary of changes: include/math.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d1c42bb23082b2a1c10016ee94c3f7cdb678a2e8 -- DragonFly BSD source repository
文章代碼(AID): #1CB5A7Jo (DFBSD_commit)