cond.c (98500) | cond.c (103508) |
---|---|
1/* 2 * Copyright (c) 1988, 1989, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 1988, 1989 by Adam de Boor 5 * Copyright (c) 1989 by Berkeley Softworks 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 26 unchanged lines hidden (view full) --- 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * @(#)cond.c 8.2 (Berkeley) 1/2/94 40 */ 41 42#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1988, 1989, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 1988, 1989 by Adam de Boor 5 * Copyright (c) 1989 by Berkeley Softworks 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 26 unchanged lines hidden (view full) --- 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * @(#)cond.c 8.2 (Berkeley) 1/2/94 40 */ 41 42#include <sys/cdefs.h> |
43__FBSDID("$FreeBSD: head/usr.bin/make/cond.c 98500 2002-06-20 19:28:00Z jmallett $"); | 43__FBSDID("$FreeBSD: head/usr.bin/make/cond.c 103508 2002-09-17 22:31:26Z jmallett $"); |
44 45/*- 46 * cond.c -- 47 * Functions to handle conditionals in a makefile. 48 * 49 * Interface: 50 * Cond_Eval Evaluate the conditional in the passed line. 51 * --- 600 unchanged lines hidden (view full) --- 652 } 653 } 654 655 Buf_AddByte(buf, (Byte)0); 656 657 string = (char *)Buf_GetAll(buf, (int *)0); 658 Buf_Destroy(buf, FALSE); 659 | 44 45/*- 46 * cond.c -- 47 * Functions to handle conditionals in a makefile. 48 * 49 * Interface: 50 * Cond_Eval Evaluate the conditional in the passed line. 51 * --- 600 unchanged lines hidden (view full) --- 652 } 653 } 654 655 Buf_AddByte(buf, (Byte)0); 656 657 string = (char *)Buf_GetAll(buf, (int *)0); 658 Buf_Destroy(buf, FALSE); 659 |
660 if (DEBUG(COND)) { 661 printf("lhs = \"%s\", rhs = \"%s\", op = %.2s\n", 662 lhs, string, op); 663 } | 660 DEBUGF(COND, "lhs = \"%s\", rhs = \"%s\", op = %.2s\n", 661 lhs, string, op); |
664 /* 665 * Null-terminate rhs and perform the comparison. 666 * t is set to the result. 667 */ 668 if (*op == '=') { 669 t = strcmp(lhs, string) ? False : True; 670 } else { 671 t = strcmp(lhs, string) ? True : False; --- 43 unchanged lines hidden (view full) --- 715 */ 716 while(!isspace((unsigned char) *condExpr) && 717 (*condExpr != '\0')) { 718 condExpr++; 719 } 720 } 721 } 722 | 662 /* 663 * Null-terminate rhs and perform the comparison. 664 * t is set to the result. 665 */ 666 if (*op == '=') { 667 t = strcmp(lhs, string) ? False : True; 668 } else { 669 t = strcmp(lhs, string) ? True : False; --- 43 unchanged lines hidden (view full) --- 713 */ 714 while(!isspace((unsigned char) *condExpr) && 715 (*condExpr != '\0')) { 716 condExpr++; 717 } 718 } 719 } 720 |
723 if (DEBUG(COND)) { 724 printf("left = %f, right = %f, op = %.2s\n", left, 725 right, op); 726 } | 721 DEBUGF(COND, "left = %f, right = %f, op = %.2s\n", left, 722 right, op); |
727 switch(op[0]) { 728 case '!': 729 if (op[1] != '=') { 730 Parse_Error(PARSE_WARNING, 731 "Unknown operator"); 732 goto error; 733 } 734 t = (left != right ? True : False); --- 523 unchanged lines hidden --- | 723 switch(op[0]) { 724 case '!': 725 if (op[1] != '=') { 726 Parse_Error(PARSE_WARNING, 727 "Unknown operator"); 728 goto error; 729 } 730 t = (left != right ? True : False); --- 523 unchanged lines hidden --- |