Changeset 168
- Timestamp:
- Oct 13, 2004, 4:06:32 AM (21 years ago)
- Location:
- trunk/src/makedep
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/makedep/def.h
r164 r168 27 27 /* $XFree86: xc/config/makedepend/def.h,v 3.13tsi Exp $ */ 28 28 29 #include "Xos.h" 30 #include "Xfuncproto.h" 29 #ifndef NO_X11 /* from mozilla */ 30 #include "X11/Xos.h" 31 #include "X11/Xfuncproto.h" 32 #endif 31 33 #include <stdlib.h> 32 34 #include <stdio.h> … … 81 83 /* 82 84 * debug levels are: 83 * 85 * 84 86 * 0 show ifn*(def)*,endif 85 87 * 1 trace defined/!defined … … 148 150 struct inclist **srcfile); 149 151 struct filepointer *getfile(char *file); 150 void included_by(struct inclist *ip, 152 void included_by(struct inclist *ip, 151 153 struct inclist *newfile); 152 154 struct inclist *newinclude(char *newfile, char *incstring); … … 159 161 void define(char *def, struct inclist *file); 160 162 void undefine(char *symbol, struct inclist *file); 161 int find_includes(struct filepointer *filep, 162 struct inclist *file, 163 struct inclist *file_red, 163 int find_includes(struct filepointer *filep, 164 struct inclist *file, 165 struct inclist *file_red, 164 166 int recursion, boolean failOK); 165 167 166 void recursive_pr_include(struct inclist *head, 168 void recursive_pr_include(struct inclist *head, 167 169 char *file, char *base); 168 void add_include(struct filepointer *filep, 169 struct inclist *file, 170 struct inclist *file_red, 170 void add_include(struct filepointer *filep, 171 struct inclist *file, 172 struct inclist *file_red, 171 173 char *include, int type, 172 174 boolean failOK); -
trunk/src/makedep/include.c
r164 r168 29 29 30 30 #include "def.h" 31 32 /* mozilla: */ 33 #ifdef _MSC_VER 34 #define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR) 35 #endif 31 36 32 37 extern struct inclist inclist[ MAXFILES ], … … 119 124 char **tp = cp; 120 125 121 do 126 do 122 127 *tp++ = *fp; /* move all the pointers down */ 123 128 while (*fp++); … … 267 272 (type == INCLUDENEXTDOT) || 268 273 (*include == '/')) { 269 if (stat(include, &st) == 0 )274 if (stat(include, &st) == 0 && !S_ISDIR(st.st_mode)) /* mozilla */ 270 275 return newinclude(include, include); 271 276 if (show_where_not) … … 289 294 } 290 295 remove_dotdot(path); 291 if (stat(path, &st) == 0 )296 if (stat(path, &st) == 0 && !S_ISDIR(st.st_mode)) /* mozilla */ 292 297 return newinclude(path, include); 293 298 if (show_where_not) … … 307 312 sprintf(path, "%s/%s", *pp, include); 308 313 remove_dotdot(path); 309 if (stat(path, &st) == 0 ) {314 if (stat(path, &st) == 0 && !S_ISDIR(st.st_mode)) { /* mozilla */ 310 315 includedirsnext = pp + 1; 311 316 return newinclude(path, include); -
trunk/src/makedep/main.c
r164 r168 158 158 char **undeflist = NULL; 159 159 int numundefs = 0, i; 160 register char offset; /* mozilla */ 160 161 161 162 ProgramName = argv[0]; … … 232 233 break; 233 234 case 'D': 235 offset = 2; /* mozilla */ 236 Imaginary Buffer Line 234 237 if (argv[0][2] == '\0') { 235 238 argv++; 236 239 argc--; 237 } 238 for (p=argv[0] + 2; *p ; p++) 240 offset = 0; 241 } 242 /* offset +1 here since first def letter 243 * cannot be `=` 244 */ 245 for (p = argv[0] + offset + 1; *p; p++) /* mozilla */ 239 246 if (*p == '=') { 240 247 *p = ' '; 241 248 break; 242 249 } 243 define(argv[0] + 2, &maininclist);250 define(argv[0] + offset, &maininclist); /* mozilla */ 244 251 break; 245 252 case 'I': … … 260 267 undeflist = realloc(undeflist, 261 268 numundefs * sizeof(char *)); 269 offset = 2; /* mozilla */ 262 270 if (argv[0][2] == '\0') { 263 271 argv++; 264 272 argc--; 265 } 266 undeflist[numundefs - 1] = argv[0] + 2; 273 offset = 0; /* mozilla */ 274 } 275 undeflist[numundefs - 1] = argv[0] + offset; /* mozilla */ 267 276 break; 268 277 case 'Y': … … 510 519 * eliminate \r chars from file 511 520 */ 512 static int 521 static int 513 522 elim_cr(char *buf, int sz) 514 523 { … … 634 643 whitespace = TRUE; 635 644 } 636 645 637 646 if (*p == '/' && (p+1) < eof && *(p+1) == '*') { 638 647 /* Consume C comments */ … … 662 671 } 663 672 else if (*p == '?' && (p+3) < eof && 664 *(p+1) == '?' && 673 *(p+1) == '?' && 665 674 *(p+2) == '/' && 666 675 *(p+3) == '\n') { … … 698 707 *(p++) = '\0'; 699 708 /* punt lines with just # (yacc generated) */ 700 for (cp = bol+1; 709 for (cp = bol+1; 701 710 *cp && (*cp == ' ' || *cp == '\t'); cp++); 702 711 if (*cp) goto done;
Note:
See TracChangeset
for help on using the changeset viewer.