On Saturday, 26 March 2005 we wrote…
Saturday, 26 March 2005
Careful Where You Put Your Hash
In which we discover the delights of # placement.
If you’ve written code for more than one platform you’ve probably come across something that looks like this:
#if defined(_WIN32)
#elif defined(LINUX)
#endif
A lot of us indent to make things more readable so you might end up with this:
#if defined(_WIN32)
#include <io.h>
#elif defined(LINUX)
#include <ioctl.h>
#endif
According to K&R that’s valid. But some tools don’t do what you think. Take makedepend for example. I just discovered that if the line does not start with # then makedepend ignores it. So that file you…
Tags:
programmingAbout
I'm the chief geek of yaean design based in Shanghai.
Tags
- 3D
- ajax
- art
- audio
- bbc
- books
- browsers
- business
- cars
- china
- chinglish
- christmas
- cms
- crowdsourcing
- design
- django
- education
- food
- football
- games
- generators
- gentoo
- guitars
- health
- history
- hongkong
- html5
- humans
- humour
- inspiration
- internet
- iphone
- javascript
- kids
- lego
- life
- linux
- mac
- magazines
- maps
- maths
- media
- mobile
- movies
- music
- mysql
- nasa
- nature
- news
- p4p
- parenthood
- photography
- physics
- poetry
- postgresql
- privacy
- programming
- python
- radio
- research
- restaurants
- robots
- ruby
- security
- shanghai
- solar
- space
- standards
- stories
- superpowers
- tagclouds
- taste
- tech
- travel
- type
- ui
- uk
- ux
- video
- visualisation
- web
- windows
- word
- writing
- yajogo