thantik / tlc5940arduino

Automatically exported from code.google.com/p/tlc5940arduino
0 stars 0 forks source link

Header files contain complete non-inline functions #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try including tlc_servo.h in a library

What is the expected output? What do you see instead?
Expect clean compilation - instead you get multiple definitions of the 
functions in the header file.

Please provide any additional information below.
This can be cured by either not having the functions in the header file (read 
up on the function of the "utility" folder of the Arduino library system), or 
marking the functions as "inline" so they get compiled directly as inline code 
and never get linked as separate functions.  Yes, this increases the code size, 
but fixes the problem.

Note: You never ever include full functions in a header file unless they are 
INLINE.  Functions go in C or CPP files, NOT header files!

Original issue reported on code.google.com by sqsolr...@gmail.com on 5 Apr 2013 at 11:23