#include just means "copy and paste this file here", so if you do the C&P manually, you get:
main.cpp#define TESTING123
#ifndef OTHER_H
# define OTHER_H
# ifdef TESTING123
extern int x;
# endif
#endif
int main ( ) {
x++;
return 0;
}other.cpp#ifndef OTHER_H
# define OTHER_H
# ifdef TESTING123
extern int x;
# endif
#endif
#ifdef TESTING123
int x= 0;
#endif
And if you then resolve the #if conditions manually, you get:
main.cppextern int x;
int main ( ) {
x++;
return 0;
}other.cpp