Robert, MrBCX regarding double CR/LF:
I don't know much about the BCX translator, nor how to use it. I'm not terribly interested in going through a big auto-translated C file to find a *possible* bug (it could be anything, at this point). Can you boil down the problem to a C file of a more manageble size?
Pelle,
BCX uses simple disk i/o as you'll see in the samples from the generated BCX source code below.
The first 36 lines are emitted correctly -
only one crlf// *********************************************************************
// Created with BCX32 - BASIC To C/C++ Translator (V) 6.2.2 (2010/10/24)
// BCX (c) 1999 - 2009 by Kevin Diggins
// *********************************************************************
// Translated for compiling with a C Compiler
// *********************************************************************
#define WIN32_LEAN_AND_MEAN // limits reading seldom used header files
#include <windows.h> // Win32 Header File
#include <windowsx.h> // Win32 Header File
#include <commctrl.h> // Win32 Header File
#include <commdlg.h> // Win32 Header File
#include <mmsystem.h> // Win32 Header File
#include <shellapi.h> // Win32 Header File
#include <shlobj.h> // Win32 Header File
#include <richedit.h> // Win32 Header File
#include <wchar.h> // Win32 Header File
#include <objbase.h> // Win32 Header File
#include <ocidl.h> // Win32 Header File
#include <winuser.h> // Win32 Header File
#include <olectl.h> // Win32 Header File
#include <oaidl.h> // Win32 Header File
#include <ole2.h> // Win32 Header File
#include <oleauto.h> // Win32 Header File
#include <conio.h>
#include <direct.h>
#include <ctype.h>
#include <io.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <stdlib.h>
#include <setjmp.h>
#include <time.h>
#include <stdarg.h>
#include <process.h>
// *************************************************
These are the BCX statements that emit the includes above fprintf(Outfile,"%s\n","// *********************************************************************");
fprintf(Outfile,"%s%s\n","// Created with BCX32 - BASIC To C/C++ Translator (V) ",Version);
fprintf(Outfile,"%s\n","// BCX (c) 1999 - 2009 by Kevin Diggins");
fprintf(Outfile,"%s\n","// *********************************************************************");
fprintf(Outfile,"%s\n","#include <windows.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <windowsx.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <commctrl.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <commdlg.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <mmsystem.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <shellapi.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <shlobj.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <richedit.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <wchar.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <objbase.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <ocidl.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <winuser.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <olectl.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <oaidl.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <ole2.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <oleauto.h> // Win32 Header File ");
fprintf(Outfile,"%s\n","#include <conio.h>");
fprintf(Outfile,"%s\n","#include <direct.h>");
fprintf(Outfile,"%s\n","#include <ctype.h>");
fprintf(Outfile,"%s\n","#include <io.h>");
fprintf(Outfile,"%s\n","#include <math.h>");
fprintf(Outfile,"%s\n","#include <stdio.h>");
fprintf(Outfile,"%s\n","#include <string.h>");
fprintf(Outfile,"%s\n","#include <stddef.h>");
fprintf(Outfile,"%s\n","#include <stdlib.h>");
fprintf(Outfile,"%s\n","#include <setjmp.h>");
fprintf(Outfile,"%s\n","#include <time.h>");
fprintf(Outfile,"%s\n","#include <stdarg.h>");
fprintf(Outfile,"%s\n","#include <process.h>");
fprintf(Outfile,"%s\n","");
The remaining 40,000+ lines are emitted incorrectly -- two crlfNothing special ... just lots more fprint statements.
fprintf(Outfile,"%s\n","// END BCXRTHEADER\n\n");
fprintf(Outfile,"%s\n","");
fprintf(Outfile,"%s\n","int main(int argc, char *argv[])");
This problem does not exist when compiled with Pelles C 6.00 or earlier, MSVC 8.0, Lcc-Win32, or Borland's Bcc55.