Author Topic: $CPPHDR  (Read 463 times)

jcfuller

  • Sr. Member
  • ****
  • Posts: 268
    • View Profile
$CPPHDR
« on: September 25, 2020, 08:18:30 AM »
Kevin,
  I may have mentioned this before?
Why do we need both $CPP and $CPPHDR in our source?
I would reason $CPPHDR (Docpphdr) should automagically add UseCpp = TRUE

James


MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 714
    • View Profile
Re: $CPPHDR
« Reply #1 on: September 25, 2020, 09:14:19 AM »
JC - On the surface, I agree with your view. 

But since I had mostly NOTHING to do with adding c++ specific features, you're asking the wrong guy.

It looks to me that $CPPHDR could be combined with $CPP but there might be more to it.

Robert

  • Hero Member
  • *****
  • Posts: 555
    • View Profile
Re: $CPPHDR
« Reply #2 on: September 25, 2020, 02:36:31 PM »
Kevin,
  I may have mentioned this before?
Why do we need both $CPP and $CPPHDR in our source?
I would reason $CPPHDR (Docpphdr) should automagically add UseCpp = TRUE

James

Hi James:

$CPP is used by some who do not use $CPPHDR and who do not use the -c command line option.

I would argue to remove $CPPHDR and let users add whatever headers they want. None of the BCX examples in The C++ Tutorial for BCX Users use $CPPHDR.

And then there is the $NOIO directive. Really, W.T.F?

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 714
    • View Profile
Re: $CPPHDR
« Reply #3 on: September 25, 2020, 03:29:53 PM »

And then there is the $NOIO directive. Really, W.T.F?


Thank you for saying what I was thinking!

jcfuller

  • Sr. Member
  • ****
  • Posts: 268
    • View Profile
Re: $CPPHDR
« Reply #4 on: September 25, 2020, 05:00:01 PM »

the $NOIO was added I believe before $CPPHDR. Robert I thought it was you that requested/implemented $CPPHDR??
 C++ file IO brings in exception handling which really bloats the exe . I think File IO was part of a lot of #includes for $CPP (before $CPPHDR)


James

Robert

  • Hero Member
  • *****
  • Posts: 555
    • View Profile
Re: $CPPHDR
« Reply #5 on: September 25, 2020, 05:29:13 PM »

the $NOIO was added I believe before $CPPHDR. Robert I thought it was you that requested/implemented $CPPHDR??
 C++ file IO brings in exception handling which really bloats the exe . I think File IO was part of a lot of #includes for $CPP (before $CPPHDR)


James

Hi James:

Technically, according to the BCX_Revisions.txt, I was the implementor of $CPPHDR. However that was to remove it from $CPP where you had first implemented the includes

Code: [Select]

2012/07/30 10:30 GMT-8
* Changes to 6.9.0 from 6.9.1
* James Fuller
* Changed
*  IF UseCpp Then
*    FPRINT FP_WRITE, "// Additional lines may be needed"
*    FPRINT FP_WRITE, "#if defined( __cplusplus )"
*    FPRINT FP_WRITE, "  using namespace std;"
*    If UseIO Then
*      FPRINT FP_WRITE, "  #include <iostream>"
*    End If
*    FPRINT FP_WRITE, "  #include <fstream>"
*    FPRINT FP_WRITE, "  #include <sstream>"
*    FPRINT FP_WRITE, "  #include <iomanip>"
*    FPRINT FP_WRITE, "  typedef std::string stdstr;"
*    FPRINT FP_WRITE, "#endif"
*  END IF
*
* to
*
*  IF UseCpp Then
*    FPRINT FP_WRITE, "// Additional lines may be needed"
*    FPRINT FP_WRITE, "#if defined( __cplusplus )"
*    If UseIO Then
*      FPRINT FP_WRITE, "  #include <iostream>"
*    End If
*    FPRINT FP_WRITE, "  #include <fstream>"
*    FPRINT FP_WRITE, "  #include <sstream>"
*    FPRINT FP_WRITE, "  #include <iomanip>"
*    FPRINT FP_WRITE, "  typedef std::string stdstr;"
*    FPRINT FP_WRITE, "  using namespace std;"
*    FPRINT FP_WRITE, "#endif"
*  END IF

 

I spent a lot of time working with you to implement C++ functionality into BCX. Dozens if not hundreds of hours. But there is absolutely no question that you were the leader in that effort. I did not have nor do I now have the understanding or skills to do that on my own.

I wish that you could contribute to helping clean up the existing C++ BCX code, for example, in regard to the register and auto class specifiers and other OxBow C++ code. I do not have any idea whether the auto or register references  are needed in C++. If I knew they were needed I would be O.K. with them being there but it pisses me off that possibly they are just sitting there, doing nothing, being completely useless cluttering things up.

I know you could help, and I must say it irks me that you have not offered to clean that code up. You and I and Wayne are responsible for most of that mess. It would be nice if you would help clean it up.
 

jcfuller

  • Sr. Member
  • ****
  • Posts: 268
    • View Profile
Re: $CPPHDR
« Reply #6 on: September 26, 2020, 05:14:33 AM »
Robert,
  My c++ knowledge was always poor at best and now with my memory getting worse I have to look up a lot of the stuff I knew in the past.
  Re: register see
      https://en.cppreference.com/w/cpp/keyword/register
  Re: auto see
  https://bcxbasiccoders.com/smf/index.php?topic=173.0
  and the link I provide in the post.
  I use it only for vector iterators in my RbFor.
  I have RbFor working in my Bcxpp.dll.

  Here is another auto link but a bit confusing as my past study only involved c++ 11.
https://en.cppreference.com/w/cpp/language/auto

I have no real objection to making c++ includes the user's responsibility. I have used -z in some of my testing to isolate the ones I need for a specific test.

James



Robert

  • Hero Member
  • *****
  • Posts: 555
    • View Profile
Re: $CPPHDR
« Reply #7 on: September 26, 2020, 12:52:18 PM »
Robert,
  My c++ knowledge was always poor at best and now with my memory getting worse I have to look up a lot of the stuff I knew in the past.
  Re: register see
      https://en.cppreference.com/w/cpp/keyword/register
  Re: auto see
  https://bcxbasiccoders.com/smf/index.php?topic=173.0
  and the link I provide in the post.
  I use it only for vector iterators in my RbFor.
  I have RbFor working in my Bcxpp.dll.

  Here is another auto link but a bit confusing as my past study only involved c++ 11.
https://en.cppreference.com/w/cpp/language/auto

I have no real objection to making c++ includes the user's responsibility. I have used -z in some of my testing to isolate the ones I need for a specific test.

James

Hi James:

Thank you for your reply.

I will study your suggestions and have another look at the problem in the BCX code that I was complaining about.

Memory ???  I know I can remember the first line of the Rolling Stones tune, 'Mother's Little Helper'

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 714
    • View Profile
Re: $CPPHDR
« Reply #8 on: September 27, 2020, 11:24:24 AM »
Robert,
  My c++ knowledge was always poor at best and now with my memory getting worse I have to look up a lot of the stuff I knew in the past.
  Re: register see
      https://en.cppreference.com/w/cpp/keyword/register
  Re: auto see
  https://bcxbasiccoders.com/smf/index.php?topic=173.0
  and the link I provide in the post.
  I use it only for vector iterators in my RbFor.
  I have RbFor working in my Bcxpp.dll.

  Here is another auto link but a bit confusing as my past study only involved c++ 11.
https://en.cppreference.com/w/cpp/language/auto

I have no real objection to making c++ includes the user's responsibility. I have used -z in some of my testing to isolate the ones I need for a specific test.

James

Primum non nocere

It was unfortunate that our C++ enthusiasts co-opted certain words ( THIS,  AUTO,  NEW, DELETE, VECTOR, CLASS, INTERFACE, etc ) for their own special interests, veiled under the cheap glitter of C++ hype, at the expense of other BCX users, whose long-running BCX programs, that had used those words for other purposes, needed to be edited at their expense.  A well-implemented $CPP directive would have respected existing C99 focused BCX programs.

We cannot change history but we can shape the future.