[haiku-commits] Re: BRANCH mmadia-github.separate-build-environment - in headers/build: config_target os/support os_target/support

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 03 Aug 2012 13:13:22 +0200

On 2012-08-03 at 02:49:15 [+0200], mmadia-github.separate-build-environment 
<community@xxxxxxxxxxxx> wrote:
[...]
> diff --git a/headers/build/os_target/support/target_SupportDefs.h 
> b/headers/build/os_target/support/target_SupportDefs.h
> new file mode 100644
> index 0000000..ef5398d
> --- /dev/null
> +++ b/headers/build/os_target/support/target_SupportDefs.h
[...]
> +/* Empty string ("") */
> +#ifdef __cplusplus
> +// NOTE: #8730 -- does this become _HAIKU_BUILD_B_EMPTY_STRING ?
> +extern const char *B_EMPTY_STRING;
> +#endif

Constant declarations must be handled like function prototypes.  Define a new 
helper macro similar to _HAIKU_BUILD_DECLARE_FUNCTION in HaikuBuild.h for 
that purpose (untested):

        #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER
                #define _HAIKU_BUILD_DECLARE_CONSTANT(type, name) \
                        extern type _haiku_build##name; \
        #else
                #define _HAIKU_BUILD_DECLARE_CONSTANT(type, name) \
                        extern type _haiku_build##name; \
                        extern type name \
                                __asm__(_HAIKU_BUILD_ASMNAME("_haiku_build" 
#name));
        #endif

To be used like:

        _HAIKU_BUILD_DECLARE_CONSTANT(const char*, B_EMPTY_STRING)

Should you encounter arrays, just add a variation 
_HAIKU_BUILD_DECLARE_CONSTANT_ETC with a third parameter (which would be 
passed everything after the constant name). The same goes for function 
definitions with gcc attributes (like printf()) -- add a 
_HAIKU_BUILD_DECLARE_FUNCTION_ETC macro with an extra parameter.

[...]
> +#endif    /* _SUPPORT_DEFS_H */

The conditional definition of the B_* and _haiku_build_{min,max} macros are 
missing.

CU, Ingo

Other related posts: