mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-26 17:17:31 +09:00
Preprocessor warnings should not be fatal errors
This commit is contained in:
parent
f5048f2a1d
commit
0066c408f1
2 changed files with 6 additions and 13 deletions
|
|
@ -460,7 +460,7 @@ class JarMaker(object):
|
||||||
pp.setMarker('%')
|
pp.setMarker('%')
|
||||||
pp.out = outf
|
pp.out = outf
|
||||||
pp.do_include(inf)
|
pp.do_include(inf)
|
||||||
pp.failUnused(realsrc)
|
pp.warnUnused(realsrc)
|
||||||
outf.close()
|
outf.close()
|
||||||
inf.close()
|
inf.close()
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -316,20 +316,13 @@ class Preprocessor:
|
||||||
if defines:
|
if defines:
|
||||||
self.context.update(defines)
|
self.context.update(defines)
|
||||||
|
|
||||||
def failUnused(self, file):
|
def warnUnused(self, file):
|
||||||
msg = None
|
msg = None
|
||||||
if self.actionLevel == 0 and not self.silenceMissingDirectiveWarnings:
|
if self.actionLevel == 0 and not self.silenceMissingDirectiveWarnings:
|
||||||
msg = 'no preprocessor directives found'
|
sys.stderr.write('{0}: WARNING: no preprocessor directives found\n'.format(file))
|
||||||
elif self.actionLevel == 1:
|
elif self.actionLevel == 1:
|
||||||
msg = 'no useful preprocessor directives found'
|
sys.stderr.write('{0}: WARNING: no useful preprocessor directives found\n'.format(file))
|
||||||
if msg:
|
pass
|
||||||
class Fake(object): pass
|
|
||||||
fake = Fake()
|
|
||||||
fake.context = {
|
|
||||||
'FILE': file,
|
|
||||||
'LINE': None,
|
|
||||||
}
|
|
||||||
raise Preprocessor.Error(fake, msg, None)
|
|
||||||
|
|
||||||
def setMarker(self, aMarker):
|
def setMarker(self, aMarker):
|
||||||
"""
|
"""
|
||||||
|
|
@ -385,7 +378,7 @@ class Preprocessor:
|
||||||
self.out = output
|
self.out = output
|
||||||
|
|
||||||
self.do_include(input, False)
|
self.do_include(input, False)
|
||||||
self.failUnused(input.name)
|
self.warnUnused(input.name)
|
||||||
|
|
||||||
if depfile:
|
if depfile:
|
||||||
mk = Makefile()
|
mk = Makefile()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue