Great Wall of China

The Great Wall of China served not only as a defense against foreign tribes. It was also meant to protect against demons "prowling" the barren lands.

An excerpt from the article 18 facts about Great Wall of China
At the time, it was believed that demons could not cross curved structures, which is why the wall does not have a straight line.