error: pasting "_XXXX" and "(" does not give a valid preprocessing token

Im trying to enable rtc rv8263 support by copying changes made to support it from 

https://github.com/zephyrproject-rtos/zephyr/commit/37d6bc082782f0b66420c68f4ff57db5eb283d90

https://github.com/zephyrproject-rtos/zephyr/commit/db9b45a7b3f0d2a2b63a840d8d7d3abfcdb7709b

github.com/.../4c880f4b0a5fa6d55d731ddfec8b040361998427

to my nordic zephyr at /opt/nordic/ncs/v2.6.1/zephyr

I use the nrf52840dk board

Added this to prj.conf:

CONFIG_I2C=y
CONFIG_RTC=y
CONFIG_RTC_RV8263=y

This is what i added to app.overlay:

Fullscreen
1
2
3
4
5
6
7
8
9
10
&i2c0 { /* SDA P0.26, SCL P0.27 */
status = "okay";
rv8263: rv8263@68 {
compatible = "microcrystal,rv-8263-c8";
reg = <0x68>;
status = "okay";
int-gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
clkout = <32768>;
};
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Currently i get the following compile error:

In file included from /opt/nordic/ncs/v2.6.1/zephyr/include/zephyr/sys/util_macro.h:34,
from /opt/nordic/ncs/v2.6.1/zephyr/include/zephyr/irq_multilevel.h:15,
from /opt/nordic/ncs/v2.6.1/zephyr/include/zephyr/devicetree.h:20,
from /opt/nordic/ncs/v2.6.1/zephyr/include/zephyr/device.h:12,
from /opt/nordic/ncs/v2.6.1/zephyr/drivers/rtc/rtc_rv8263.c:5:
/opt/nordic/ncs/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:59:21: error: pasting "_XXXX" and "(" does not give a valid preprocessing token
59 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
| ^~~~~
/opt/nordic/ncs/v2.6.1/zephyr/include/zephyr/sys/util_macro.h:180:9: note: in expansion of macro 'Z_COND_CODE_1'
180 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~~~
/opt/nordic/ncs/v2.6.1/zephyr/include/zephyr/sys/util_macro.h:224:9: note: in expansion of macro 'COND_CODE_1'
224 | COND_CODE_1(_flag, _code, ())
| ^~~~~~~~~~~
/opt/nordic/ncs/v2.6.1/zephyr/drivers/rtc/rtc_rv8263.c:715:17: note: in expansion of macro 'IF_ENABLED'
715 | IF_ENABLED(DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios), \
| ^~~~~~~~~~
/Users/henrihallik/metercs/build_debug/zephyr/include/generated/devicetree_generated.h:15386:58: note: in expansion of macro 'RV8263_DEFINE'
15386 | #define DT_FOREACH_OKAY_INST_microcrystal_rv_8263_c8(fn) fn(0)
| ^~
/opt/nordic/ncs/v2.6.1/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in expansion of macro 'DT_FOREACH_OKAY_INST_microcrystal_rv_8263_c8'
105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
| ^
/opt/nordic/ncs/v2.6.1/zephyr/drivers/rtc/rtc_rv8263.c:721:1: note: in expansion of macro 'DT_INST_FOREACH_STATUS_OKAY'
721 | DT_INST_FOREACH_STATUS_OKAY(RV8263_DEFINE)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
[205/406] Building C object zephyr/drivers/spi/CMakeFiles/drivers__spi.dir/spi_nrfx_spim.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/580e4ef81c/bin/cmake --build /Users/henrihallik/metercs/build_debug

* The terminal process terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.

rv8263_support.patch

I have attached git patch that contains all the changes i have made to nrf sdk zephyr installation. This can be applied by:

cd /opt/nordic/ncs/v2.6.1/zephyr
git apply /path/to/rv8263_support.patch

to easily make the same changes i have made to reproduce the issue.

How to resolve this compile issue?