Lines Matching refs:ret

265 		ret = Snippet([], [], [])
267 ret.lines += s.lines
269 ret.provides[k] = True
271 ret.requires[k] = True
272 return ret
466 ret = []
473 ret += sn.lines
482 return '\n'.join(ret)
485 ret = []
492 ret.append(line)
496 ret.append(line)
497 return '\n'.join(ret)
589 ret = []
598 ret.append(doc)
599 return ret
602 ret = []
611 ret.append(doc)
612 return ret
679 ret = []
683 ret.append(para)
684 return '\n\n'.join(ret)
733 ret = FileBuilder(use_cpp_warning=opts.use_cpp_warning)
738 ret.rst_heading(title, '=', doubled=True)
756 ret.empty()
757 ret.rst_heading(get_tag_title(tag), '=')
761 ret.empty()
762 ret.line(rst_format(tag_desc))
765 ret.empty()
766 ret.rst_heading(dname, '-')
769 ret.empty()
770 ret.line(rst_format(desc))
773 ret.empty()
774 ret.line('Default: ``' + str(doc['default']) + '``') # XXX: rst or other format
781 ret.empty()
782 return ret.join()
816 def emit_default_from_config_meta(ret, doc, forced_opts, undef_done): argument
822 ret.line('#define ' + defname)
825 ret.line('#undef ' + defname)
832 ret.line('#define ' + defname + ' ' + cint_encode(defval))
835 ret.line('#define ' + defname + ' ' + defval)
839 ret.line(defval['verbatim'])
842 ret.line('#define ' + defname + ' ' + cstr_encode(defval['string']))
850 def add_legacy_feature_option_checks(opts, ret): argument
851 ret.chdr_block_heading('Checks for legacy feature options (DUK_OPT_xxx)')
852 ret.empty()
869 ret.line('#if defined(%s)' % optname)
871ret.cpp_warning_or_error('unsupported legacy feature option %s used, consider options: %s' % (optn…
873ret.cpp_warning_or_error('unsupported legacy feature option %s used' % optname, opts.sanity_strict)
874 ret.line('#endif')
876 ret.empty()
880 def add_config_option_checks(opts, ret): argument
881 ret.chdr_block_heading('Checks for config option consistency (DUK_USE_xxx)')
882 ret.empty()
897 ret.line('#if defined(%s)' % dname)
898ret.cpp_warning_or_error('unsupported config option used (option has been removed): %s' % dname, o…
899 ret.line('#endif')
901 ret.line('#if defined(%s)' % dname)
902ret.cpp_warning_or_error('unsupported config option used (option has been deprecated): %s' % dname…
903 ret.line('#endif')
906 ret.line('#if defined(%s) && !defined(%s)' % (dname, req))
907ret.cpp_warning_or_error('config option %s requires option %s (which is missing)' % (dname, req), …
908 ret.line('#endif')
911 ret.line('#if defined(%s) && defined(%s)' % (dname, req))
912ret.cpp_warning_or_error('config option %s conflicts with option %s (which is also defined)' % (dn…
913 ret.line('#endif')
915 ret.empty()
916 ret.snippet_relative('cpp_exception_sanity.h.in')
917 ret.empty()
920 def add_override_defines_section(opts, ret): argument
921 ret.empty()
922 ret.line('/*')
923 ret.line(' * You may add overriding #define/#undef directives below for')
924 ret.line(' * customization. You of course cannot un-#include or un-typedef')
925 ret.line(' * anything; these require direct changes above.')
926 ret.line(' */')
927 ret.empty()
928 ret.line('/* __OVERRIDE_DEFINES__ */')
929 ret.empty()
933 def add_feature_option_handling(opts, ret, forced_opts, already_provided_keys): argument
934 ret.chdr_block_heading('Feature option handling')
956 ret.line('#if defined(%s)' % feature_define)
958 ret.line('#undef %s' % config_define)
960 ret.line('#define %s' % config_define)
961 ret.line('#elif defined(%s)' % feature_no_define)
963 ret.line('#define %s' % config_define)
965 ret.line('#undef %s' % config_define)
966 ret.line('#else')
973 ret.line('/* Already provided above */')
977 ret.line('/* Already provided above */')
979 emit_default_from_config_meta(ret, doc, forced_opts, undef_done)
980 ret.line('#endif')
982 ret.lines(doc['feature_snippet'])
986 ret.empty()
988 ret.empty()
995 def add_duk_active_defines_macro(ret): argument
996 ret.chdr_block_heading('DUK_ACTIVE_DEFINES macro (development only)')
1002 ret.line('#if defined(%s)' % defname)
1003 ret.line('#define DUK_ACTIVE_DEF%d " %s"' % (idx, defname))
1004 ret.line('#else')
1005 ret.line('#define DUK_ACTIVE_DEF%d ""' % idx)
1006 ret.line('#endif')
1014 ret.line('#define DUK_ACTIVE_DEFINES ("Active: ["' + ' '.join(tmp) + ' " ]")')
1035 ret = FileBuilder(base_dir=os.path.join(meta_dir, 'header-snippets'), \
1053 ret.line('/*')
1054 ret.line(' * duk_config.h configuration header generated by genconfig.py.')
1055 ret.line(' *')
1056 ret.line(' * Git commit: %s' % opts.git_commit or 'n/a')
1057 ret.line(' * Git describe: %s' % opts.git_describe or 'n/a')
1058 ret.line(' * Git branch: %s' % opts.git_branch or 'n/a')
1059 ret.line(' *')
1061 ret.line(' * Platform: ' + opts.platform)
1063 ret.line(' * Supported platforms:')
1065 ret.line(' * - %s' % platf.get('name', platf.get('check')))
1066 ret.line(' *')
1068 ret.line(' * Architecture: ' + opts.architecture)
1070 ret.line(' * Supported architectures:')
1072 ret.line(' * - %s' % arch.get('name', arch.get('check')))
1073 ret.line(' *')
1075 ret.line(' * Compiler: ' + opts.compiler)
1077 ret.line(' * Supported compilers:')
1079 ret.line(' * - %s' % comp.get('name', comp.get('check')))
1080 ret.line(' *')
1081 ret.line(' */')
1082 ret.empty()
1083 ret.line('#if !defined(DUK_CONFIG_H_INCLUDED)')
1084 ret.line('#define DUK_CONFIG_H_INCLUDED')
1085 ret.empty()
1087 ret.chdr_block_heading('Intermediate helper defines')
1096 ret.chdr_comment_line('DLL build detection')
1097 ret.line('#if defined(DUK_OPT_DLL_BUILD)')
1098 ret.line('#define DUK_F_DLL_BUILD')
1099 ret.line('#elif defined(DUK_OPT_NO_DLL_BUILD)')
1100 ret.line('#undef DUK_F_DLL_BUILD')
1101 ret.line('#else')
1103 ret.line('/* configured for DLL build */')
1104 ret.line('#define DUK_F_DLL_BUILD')
1106 ret.line('/* not configured for DLL build */')
1107 ret.line('#undef DUK_F_DLL_BUILD')
1108 ret.line('#endif')
1109 ret.empty()
1111 idx_deps = len(ret.vals) # position where to emit DUK_F_xxx dependencies
1117 ret.chdr_block_heading('Platform: ' + opts.platform)
1119 ret.snippet_relative('platform_cppextras.h.in')
1120 ret.empty()
1126 ret.snippet_absolute(abs_fn)
1128 ret.chdr_block_heading('Platform autodetection')
1130 ret.snippet_relative('platform_cppextras.h.in')
1131 ret.empty()
1141 ret.line('#if defined(%s)' % check)
1144 ret.line('#else')
1146 ret.line('#elif defined(%s)' % check)
1147 ret.line('/* --- %s --- */' % platf.get('name', '???'))
1148 ret.snippet_absolute(abs_fn)
1149 ret.line('#endif /* autodetect platform */')
1151 ret.empty()
1152 ret.snippet_relative('platform_sharedincludes.h.in')
1153 ret.empty()
1160 ret.chdr_block_heading('Architecture: ' + opts.architecture)
1166 sn = ret.snippet_absolute(abs_fn)
1172 ret.line('#define DUK_F_PACKED_TVAL_PROVIDED') # signal to fillin
1176 ret.chdr_block_heading('Architecture autodetection')
1186 ret.line('#if defined(%s)' % check)
1189 ret.line('#else')
1191 ret.line('#elif defined(%s)' % check)
1192 ret.line('/* --- %s --- */' % arch.get('name', '???'))
1193 sn = ret.snippet_absolute(abs_fn)
1199 ret.line('#define DUK_F_PACKED_TVAL_PROVIDED') # signal to fillin
1202 ret.line('#endif /* autodetect architecture */')
1204 ret.empty()
1207 ret.chdr_block_heading('Compiler: ' + opts.compiler)
1213 sn = ret.snippet_absolute(abs_fn)
1215 ret.chdr_block_heading('Compiler autodetection')
1225 ret.line('#if defined(%s)' % check)
1228 ret.line('#else')
1230 ret.line('#elif defined(%s)' % check)
1231 ret.line('/* --- %s --- */' % comp.get('name', '???'))
1232 sn = ret.snippet_absolute(abs_fn)
1233 ret.line('#endif /* autodetect compiler */')
1235 ret.empty()
1242 ret.snippet_absolute(os.path.join(meta_dir, 'helper-snippets', 'DUK_F_UCLIBC.h.in'))
1243 ret.empty()
1250 ret.snippet_relative('types1.h.in')
1251 ret.line('/* C99 types assumed */')
1252 ret.snippet_relative('types_c99.h.in')
1253 ret.empty()
1255 ret.snippet_relative('types1.h.in')
1256 ret.line('#if defined(DUK_F_HAVE_INTTYPES)')
1257 ret.line('/* C99 or compatible */')
1258 ret.empty()
1259 ret.snippet_relative('types_c99.h.in')
1260 ret.empty()
1261 ret.line('#else /* C99 types */')
1262 ret.empty()
1263 ret.snippet_relative('types_legacy.h.in')
1264 ret.empty()
1265 ret.line('#endif /* C99 types */')
1266 ret.empty()
1267 ret.snippet_relative('types2.h.in')
1268 ret.empty()
1269 ret.snippet_relative('64bitops.h.in')
1270 ret.empty()
1276 ret.chdr_block_heading('Fill-ins for platform, architecture, and compiler')
1278 ret.snippet_relative('platform_fillins.h.in')
1279 ret.empty()
1280 ret.snippet_relative('architecture_fillins.h.in')
1282 ret.empty()
1283 ret.snippet_relative('byteorder_fillin.h.in')
1285 ret.empty()
1286 ret.snippet_relative('alignment_fillin.h.in')
1287 ret.empty()
1288 ret.snippet_relative('compiler_fillins.h.in')
1289 ret.empty()
1290 ret.snippet_relative('inline_workaround.h.in')
1291 ret.empty()
1293 ret.empty()
1294 ret.snippet_relative('packed_tval_fillin.h.in')
1297 ret.snippet_relative('object_layout.h.in')
1298 ret.empty()
1301 ret.snippet_relative('reject_fast_math.h.in')
1302 ret.empty()
1307 tmp = Snippet(ret.join().split('\n'))
1308 add_feature_option_handling(opts, ret, forced_opts, tmp.provides)
1313 tmp = Snippet(ret.join().split('\n'))
1327 ret.chdr_block_heading('Forced options')
1332 ret.line('#undef ' + defname)
1335 emit_default_from_config_meta(ret, doc, forced_opts, undef_done)
1337 ret.empty()
1344 tmp = Snippet(ret.join().split('\n'))
1354 ret.chdr_block_heading('Autogenerated defaults')
1358 emit_default_from_config_meta(ret, use_defs[k], {}, False)
1360 ret.empty()
1362 ret.snippet_relative('custom_header.h.in')
1363 ret.empty()
1366 ret.chdr_block_heading('Fixups')
1368 ret.line(line)
1369 ret.empty()
1371 add_override_defines_section(opts, ret)
1376 ret.snippet_relative('date_provider.h.in')
1377 ret.empty()
1379 ret.fill_dependencies_for_snippets(idx_deps)
1382 add_legacy_feature_option_checks(opts, ret)
1384 add_config_option_checks(opts, ret)
1386 add_duk_active_defines_macro(ret)
1391 ret.snippet_relative('byteorder_derived.h.in')
1392 ret.empty()
1394 ret.line('#endif /* DUK_CONFIG_H_INCLUDED */')
1395 ret.empty() # for trailing newline
1396 return remove_duplicate_newlines(ret.join())