Subject: | strlen of a litteral string? really? |
Show quoted text
_________________________________________________________
#define ADD_TO_HASH(v) { \
key = #v; \
value = newSViv(v); \
hv_store(hv, key, strlen(key), value, 0); \
}
/* Hide this junk in the "Bits" namespace */
MODULE = Device::SerialPort PACKAGE = Device::SerialPort::Bits
SV *
get_hash()
PREINIT:
HV * hv;
char * key;
SV * value;
PROTOTYPE:
CODE:
/* initialize the hash */
hv = newHV();
#ifdef _SC_CLK_TCK
ADD_TO_HASH(_SC_CLK_TCK)
#endif
____________________________________________________
strlen on a string litteral? really? how about sizeof("X")-1?