lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Scott Shumaker <[email protected]> wrote:

> I wanted to use the built-in htonl, htons and friends.  However, they
> are actually defined as macros on my system.  This can be trivially
> fixed by writing a wrapper function.  However, I can't name the wrapped
> function 'htonl', or else I'll have conflicts with the macro.

You can probably define the wrapper functions like this:

uint32_t (htonl)(uint32_t h) {
	return htonl(h);
}

Tony.
-- 
f.anthony.n.finch  <[email protected]>  http://dotat.at/
Irish Sea: Variable mainly southwest, 4. Slight or moderate. Showers. Good.