[BUG] Changing the value of CC_ENABLE_SCRIPT_BINDING has no effect on CC_CONSTRUCTOR_ACCESS

Version: Cocos2D-X Cpp 3.16

Currently changing the value of CC_ENABLE_SCRIPT_BINDING in ccConfig.h has no effect on the value of CC_CONSTRUCTOR_ACCESS. As long as there is a value assigned to CC_ENABLE_SCRIPT_BINDING, CC_CONSTRUCTOR_ACCESS is always public.

#ifndef CC_ENABLE_SCRIPT_BINDING
#define CC_ENABLE_SCRIPT_BINDING 0 // CC_CONSTRUCTOR_ACCESS is still public
#endif

The problem is the marked line shown below.

#ifndef CC_CONSTRUCTOR_ACCESS
  #ifdef CC_ENABLE_SCRIPT_BINDING // #ifdef should be #if
    #define CC_CONSTRUCTOR_ACCESS public
  #else
    #define CC_CONSTRUCTOR_ACCESS protected
  #endif
#endif

But changing #ifdef to #if and changing CC_ENABLE_SCRIPT_BINDING to 0 causes a few issues to appear.

  1. Calling protected destructor of cocos2d::experimental::FrameBuffer in CCDirector.cpp
  2. Calling protected init of cocos2d::Sprite in UISlider.cpp
  3. Calling protected destructor of cocos2d::TextureCube in CCCameraBackgroundBrush.cpp

How should these issues be handled?

Related GitHub issue: https://github.com/cocos2d/cocos2d-x/issues/13678

@drelaptop could you please take a look of it after releasing v3.17?

Sure,I will research it after 3.17 released, about next week.