replace.h should always be included early to avoid build errors due to redefines
This is fixed in master with d93a6d2663a25bca072cd5623aea16e21ed650b8 It would be nice to get this into 4.10 (4.10.16 has this regression is already). For 4.11 and 4.12 this is required for the currenct test branches also. If this is too late for the next release it's not a big deal, I think only AIX is affected here.
Created attachment 16098 [details] cherry-picked patch for 4.10, 4.11 and 4.12
(In reply to Björn Jacke from comment #2) Pushed to autobuild-v4-{10,11,12}-test.
(In reply to Karolin Seeger from comment #3) Pushed to all branches. Closing out bug report. Thanks!
This bug was referenced in samba v4-10-stable: 40d23ea50ce8c44283c41c4cb66b12189f836007
This bug was referenced in samba v4-10-stable (Release samba-4.10.18): 40d23ea50ce8c44283c41c4cb66b12189f836007