Remove temporary opt-in for extension support of weak descriptor messages.

PiperOrigin-RevId: 640168936
diff --git a/src/google/protobuf/compiler/cpp/extension.cc b/src/google/protobuf/compiler/cpp/extension.cc
index 84020ab..1d95d61 100644
--- a/src/google/protobuf/compiler/cpp/extension.cc
+++ b/src/google/protobuf/compiler/cpp/extension.cc
@@ -209,7 +209,6 @@
       if (using_implicit_weak_descriptors) {
         p->Emit({{"enum_name", ClassName(descriptor_->enum_type(), true)}},
                 R"cc(
-#if defined(PROTOBUF_INTERNAL_TEMPORARY_WEAK_EXTENSION_OPT_IN)
                   (::_pbi::ExtensionSet::ShouldRegisterAtThisTime(
                        {{&$extendee_table$, $extendee_index$}}, $preregister$)
                        ? ::_pbi::ExtensionSet::RegisterEnumExtension(
@@ -218,10 +217,8 @@
                              $number$, $field_type$, $repeated$, $packed$,
                              $enum_name$_IsValid)
                        : (void)0),
-#else
                 )cc");
-      }
-      if (priority == kInitPriority102) {
+      } else if (priority == kInitPriority102) {
         p->Emit({{"enum_name", ClassName(descriptor_->enum_type(), true)}},
                 R"cc(
                   ::_pbi::ExtensionSet::RegisterEnumExtension(
@@ -229,11 +226,6 @@
                       $repeated$, $packed$, $enum_name$_IsValid),
                 )cc");
       }
-      if (using_implicit_weak_descriptors) {
-        p->Emit(R"cc(
-#endif
-        )cc");
-      }
 
       break;
     case FieldDescriptor::CPPTYPE_MESSAGE: {
@@ -261,7 +253,6 @@
                 {"extension_index", find_index(descriptor_->message_type())},
             },
             R"cc(
-#if defined(PROTOBUF_INTERNAL_TEMPORARY_WEAK_EXTENSION_OPT_IN)
               (::_pbi::ExtensionSet::ShouldRegisterAtThisTime(
                    {{&$extendee_table$, $extendee_index$},
                     {&$extension_table$, $extension_index$}},
@@ -274,10 +265,8 @@
                              &$extension_table$, $extension_index$, true),
                          $verify$, ::_pbi::LazyAnnotation::$lazy$)
                    : (void)0),
-#else
             )cc");
-      }
-      if (priority == kInitPriority102) {
+      } else if (priority == kInitPriority102) {
         p->Emit(R"cc(
           ::_pbi::ExtensionSet::RegisterMessageExtension(
               &$extendee$::default_instance(), $number$, $field_type$,
@@ -285,18 +274,12 @@
               $verify$, ::_pbi::LazyAnnotation::$lazy$),
         )cc");
       }
-      if (using_implicit_weak_descriptors) {
-        p->Emit(R"cc(
-#endif
-        )cc");
-      }
       break;
     }
 
     default:
       if (using_implicit_weak_descriptors) {
         p->Emit(R"cc(
-#if defined(PROTOBUF_INTERNAL_TEMPORARY_WEAK_EXTENSION_OPT_IN)
           (::_pbi::ExtensionSet::ShouldRegisterAtThisTime(
                {{&$extendee_table$, $extendee_index$}}, $preregister$)
                ? ::_pbi::ExtensionSet::RegisterExtension(
@@ -305,10 +288,8 @@
                                                            true),
                      $number$, $field_type$, $repeated$, $packed$)
                : (void)0),
-#else
         )cc");
-      }
-      if (priority == kInitPriority102) {
+      } else if (priority == kInitPriority102) {
         p->Emit(
             R"cc(
               ::_pbi::ExtensionSet::RegisterExtension(
@@ -316,11 +297,6 @@
                   $repeated$, $packed$),
             )cc");
       }
-      if (using_implicit_weak_descriptors) {
-        p->Emit(R"cc(
-#endif
-        )cc");
-      }
 
       break;
   }