From bcb963a235d017cdd21ee9cac6c110dbd10c9401 Mon Sep 17 00:00:00 2001 From: Cary R Date: Fri, 11 Nov 2011 16:22:56 -0800 Subject: [PATCH] Fix Cygwin compile problem (replace abs() call with ?: This patch fixes a compile problem in Cygwin where there are two definitions for abs() that do not match so the C++ code doesn't know which one to call. To avoid the whole mess replace the call to abs() with the appropriate ?: construct. --- vhdlpp/expression_emit.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vhdlpp/expression_emit.cc b/vhdlpp/expression_emit.cc index ed81e3b07..96e4dec4d 100644 --- a/vhdlpp/expression_emit.cc +++ b/vhdlpp/expression_emit.cc @@ -94,7 +94,8 @@ int ExpAggregate::emit_array_(ostream&out, Entity*ent, Architecture*arc, const V rc_lsb = rang.lsb()->evaluate(ent, arc, use_lsb); if (rc_msb && rc_lsb) { - int asize = abs(use_msb - use_lsb) + 1; + int asize = (use_msb >= use_lsb) ? (use_msb - use_lsb) + 1 : + (use_lsb - use_msb) + 1; out << "{" << asize << "{"; errors += aggregate_[0].expr->emit(out, ent, arc); out << "}}";