Attention for Nick…
I've been using your PROGMEMAnything.h file for a long time now with much success. Thank you for posting it here a while back. However now I'm having a problem.
I just recently installed the Arduino 1.0.4 IDE on my Raspberry Pi whereas I had been using 1.0.1 on my Windows PC. When I try to compile code on the newer IDE (possibly using a different version of GCC I'm not sure) I'm getting compile errors. Basically it's telling me that anything program memory has to be declared "const". I can go through and add that to all of my definitions but I don't know what to do with your typedef's because I never really understood how they worked. Can you offer suggestions or post a new version of your library? Here is a typical error message I'm getting.
In file included from use3b.ino:31:0: /home/pi/arduino-1.0.4/libraries/PROGMEMAnything/PROGMEMAnything.h: In instantiation of ‘T PROGMEMAnything(T*) [with T = const cmnd]’: use3b.ino:332:107: required from here /home/pi/arduino-1.0.4/libraries/PROGMEMAnything/PROGMEMAnything.h:17:7: error: uninitialized const ‘result’ [-fpermissive] use3b.ino:91:16: note: ‘const struct cmnd’ has no user-provided default constructor use3b.ino:92:8: note: and the implicitly-defined constructor does not initialize ‘long int cmnd::Value’ In file included from use3b.ino:31:0: /home/pi/arduino-1.0.4/libraries/PROGMEMAnything/PROGMEMAnything.h:18:5: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive] In file included from /home/pi/arduino-1.0.4/hardware/arduino/cores/arduino/WString.h:29:0, from /home/pi/arduino-1.0.4/hardware/arduino/cores/arduino/Print.h:26, from /home/pi/arduino-1.0.4/hardware/arduino/cores/arduino/Stream.h:26, from /home/pi/arduino-1.0.4/libraries/Wire/Wire.h:26, from use3b.ino:3: /usr/lib/gcc/avr/4.7.2/../../../avr/include/avr/pgmspace.h:1040:14: error: initializing argument 1 of ‘void* memcpy_P(void*, const void*, size_t)’ [-fpermissive]