I think I am encountering the same error.
With root and the command "nmap -p80 -d2 --script ipidseq -iR10" I keep getting the error "variable 'u16' is not declared". I am not able to find r38371 is it a new version? I am running the newest version that comes with Kali.
I am probably doing a stupid mistake but I'm new to nmap and help would be much appreciated.
r38371 is not a version but an SVN commit. There is not yet an official version of Nmap that contains this update. Instead, you can simply replace your local copy of the file with what is in GitHub or SVN.