The issue is simple. If you want accurate data no matter what C++ you encounter, you will need a full C++ parser with preprocessor capability. That's very hard to build due to the complex nature of C++ (now C++11 is pretty standard and C++14 is not far behind). Pretty much your choices are limited to:
- Edison Design Group C++ front end
- Clang
- GCC
- Our DMS Software Reengineering Toolkit with its C++ front end
- Elsa (if it still maintained)
These are big, complex engines and take effort to configure for your task (esp. GCC, which wants to be a compiler no matter what you want it to be). An additional complication that may or may not matter to you: Clang, GCC and Elsa don't handle the MS dialects, if I understand them correctly.
If you don't care if you get the right answer all the time, you could build a very simple scanner to look for apparant function heads, counting { ... } and ( ... ) to make sure you know where the function body terminates. You'll probably have to recognize namespace and class constructs, to know to look inside them for function declarations. This seems like the easiset solution, thus fastest in time and least effort.