Index: src/fortranscanner.l
===================================================================
RCS file: /cygdrive/d/cvs_doxygen/doxygen/doxygen/src/fortranscanner.l,v
retrieving revision 1.9.2.3
diff -u -r1.9.2.3 fortranscanner.l
--- src/fortranscanner.l	6 Mar 2013 18:50:53 -0000	1.9.2.3
+++ src/fortranscanner.l	16 Mar 2013 18:49:42 -0000
@@ -146,9 +146,9 @@
 };
 static QList<CommentInPrepass>  comments;
 
-#define MAX_INCLUDE_DEPTH 10
-YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
+YY_BUFFER_STATE *include_stack = NULL;
 int include_stack_ptr = 0;
+int include_stack_cnt = 0;
 
 static QFile            inputFile;
 static QCString		yyFileName;
@@ -1400,10 +1400,10 @@
 
 static void pushBuffer(QCString& buffer)
 {
-  if ( include_stack_ptr >= MAX_INCLUDE_DEPTH )
+  if (include_stack_cnt <= include_stack_ptr)
   {
-    fprintf( stderr, "Stack buffers nested too deeply" );
-    exit( 1 );
+     include_stack_cnt++;
+     include_stack = (YY_BUFFER_STATE *)realloc(include_stack, include_stack_cnt * sizeof(YY_BUFFER_STATE));
   }
   include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER;
   yy_switch_to_buffer(yy_scan_string(buffer));
