OK. I understand. You used compilation directives.
I imagined that you had managed to integrate the WiFi class with GSM, making them coexist.
Example:
The thing.handle() object would be connected to WiFi. If the router/modem went offline, thing.handle() would switch to GSM.
In your code example, from what I understand, there is no such functionality.
Another question.
I think I found bugs handling the thing.lock() and thing.unlock() methods. See this link: