For a long time, the general belief in the world of computer experts was that viruses needed to be coded for a specific type of operating system. Windows viruses could only infect Windows products, Mac viruses could only infect Mac products, etc. However, over time hackers have gotten ever craftier, and the age of compartmentalized viruses may eerily be ending.
This threat worstens now that just a few massive global manufacturers are supplying hardware for nearly all computers. For example, in 2018 researchers discovered two devestating flaws that affect processors made by Intel, AMD, and ARM, which are three of the largest processor suppliers in the world. (Intel alone supplies the chips for most PCs and more than 90% of computer servers, while ARM supplies chips to many smartphones.) In a nutshell, these flaws can allow hackers to steal the entire memory contents of computers (including mobile devices), and there is no easy fix for either flaw (as Microsoft discovered when it rushed out a software patch that ended up crashing numerous PCs). As different platforms overlap and share hardware suppliers and swap code, a virus could have a much easier time crossing between different types of devices.
There is a long precedent for this. Back in 2006, Kaspersky Labs reported a simple and relatively mild virus that could infect both Windows and Linux systems, because Windows used a small amount of Linux code in its operating system. Five years earlier in 2001, a similar problem was reported with a virus that could read whether victims were using Linux or Windows and then upload the appropriate virus to match.
In 2012, a much more dangerous virus appeared that could infect Windows, Linux, and even certain versions of Mac. It was a Trojan, and just like the 2001 virus, it could read what kind of operating system its victim was using and then install the corresponding malware.
For the most part viruses are still platform-specific, because Windows and Mac and Linux use very different operating systems which require very differently coded viruses. But nowadays, as developers make apps that are available across platforms, and different companies occasionally use matching code, and hackers get creative with smarter viruses that can carry malware for multiple types of operating systems, the possibility of a devastating cross-platform bug is always growing.