mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 07:38:21 +00:00
Make --prenodef work more sensibly, remove caveat
--prenodef was causing the preprocessor-specific options (like -std=c99 for gcpp or -V199901L for mcpp) to be omitted. That makes no sense; '-p ext' should be used when custom options are desired (also modify the text that mentions it to make that clearer). Only the macros should be omitted. The comment that warned about side effects with the order of --prenodef with respect to -p no longer applies, so remove it.
This commit is contained in:
parent
73599e0b04
commit
1207275a1e
1 changed files with 13 additions and 16 deletions
29
main.py
29
main.py
|
@ -225,14 +225,11 @@ Options marked with * are used to define the preprocessor macros __AGENTID__,
|
|||
__AGENTKEY__, __AGENTIDRAW__, __AGENTNAME__, __ASSETID__ and __SHORTFILE__,
|
||||
and have no effect if --prenodef is specified.
|
||||
|
||||
Using --prenodef before -p causes no macros whatsoever to be defined. If used
|
||||
after -p, the type casting macros string(...), key(...), etc. will be defined.
|
||||
|
||||
If filename is a dash (-) then standard input is used.
|
||||
Use: {progname} -O help for help on the optimizer control options.
|
||||
|
||||
Preprocessor modes:
|
||||
ext Invoke preprocessor
|
||||
ext Invoke a preprocessor with no default parameters
|
||||
mcpp Invoke mcpp as preprocessor, setting default parameters pertinent
|
||||
to it. Implies --precmd=mcpp
|
||||
gcpp Invoke GNU cpp as preprocessor, setting default parameters
|
||||
|
@ -583,19 +580,19 @@ def main(argv):
|
|||
|
||||
# Build preprocessor command line
|
||||
preproc_cmdline = [preproc_command] + preproc_user_args
|
||||
if preproc == 'gcpp':
|
||||
preproc_cmdline += [
|
||||
'-undef', '-x', 'c', '-std=c99', '-nostdinc',
|
||||
'-trigraphs', '-dN', '-fno-extended-identifiers',
|
||||
]
|
||||
|
||||
elif preproc == 'mcpp':
|
||||
preproc_cmdline += [
|
||||
'-e', 'UTF-8', '-I-', '-N', '-3', '-j',
|
||||
'-V199901L',
|
||||
]
|
||||
|
||||
if predefines:
|
||||
if preproc == 'gcpp':
|
||||
preproc_cmdline += [
|
||||
'-undef', '-x', 'c', '-std=c99', '-nostdinc',
|
||||
'-trigraphs', '-dN', '-fno-extended-identifiers',
|
||||
]
|
||||
|
||||
elif preproc == 'mcpp':
|
||||
preproc_cmdline += [
|
||||
'-e', 'UTF-8', '-I-', '-N', '-3', '-j',
|
||||
'-V199901L',
|
||||
]
|
||||
|
||||
preproc_cmdline += [
|
||||
'-Dinteger(...)=((integer)(__VA_ARGS__))',
|
||||
'-Dfloat(...)=((float)(__VA_ARGS__))',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue