1
0
mirror of https://github.com/meekrosoft/fff synced 2026-01-23 00:15:59 +01:00

Unified cpp and c fake definitions

This commit is contained in:
Mike Long
2012-05-25 17:44:41 +08:00
parent 6f07a118d7
commit 3345f90d12
2 changed files with 102 additions and 999 deletions

View File

@@ -37,6 +37,7 @@ def output_internal_helper_macros
define_value_function_variables_helper
define_increment_call_count_helper
define_return_fake_result_helper
define_extern_c_helper
putd "/* -- END INTERNAL HELPER MACROS -- */"
putd ""
@@ -124,6 +125,16 @@ def define_return_fake_result_helper
putd " return FUNCNAME##_fake.return_val; \\"
end
def define_extern_c_helper
putd ""
putd "#ifdef __cplusplus"
putd " #define EXTERN_C extern \"C\"{"
putd " #define END_EXTERN_C } "
putd "#else /* ansi c */"
putd " #define EXTERN_C "
putd " #define END_EXTERN_C "
putd "#endif /* cpp/ansi c */"
end
# ------ End Helper macros ------ #
#fakegen helpers to print at levels of indentation
@@ -338,11 +349,11 @@ end
def extern_c
putd "extern \"C\"{ \\" unless !$cpp_output
pushd
yield
putd "EXTERN_C \\"
pushd
yield
popd
putd "} \\" unless !$cpp_output
putd "END_EXTERN_C \\"
end
def include_guard
@@ -410,17 +421,7 @@ def output_c_and_cpp
include_guard {
output_constants
output_internal_helper_macros
putd "#ifdef __cplusplus"
$cpp_output = true
yield
putd "#else /* ansi c */"
$cpp_output = false
yield
putd "#endif /* cpp/ansi c */"
output_macro_counting_shortcuts
}
end

1072
fff3.h

File diff suppressed because it is too large Load Diff