Skip to content

Commit

Permalink
Revert "Include autolinkin.h in OnLoad.cpp only if it exists (#47875)" (
Browse files Browse the repository at this point in the history
#48341)

Summary:
Pull Request resolved: #48341

We reverted [this commit](5b2bbb8) in 0.76 and 0.77 as it was not the right fix.

## Changelog
[Internal] - Revert excluding `autolinking.h` only if it exists

Reviewed By: alanleedev

Differential Revision: D67456530

fbshipit-source-id: 0f7bfc11d23f7a8fef5100784754add5b4ecda58
  • Loading branch information
cipolleschi authored and facebook-github-bot committed Dec 20, 2024
1 parent 7b8412d commit 5443359
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@

#include <DefaultComponentsRegistry.h>
#include <DefaultTurboModuleManagerDelegate.h>
#if __has_include("<autolinking.h>")
#define AUTOLINKING_AVAILABLE 1
#include <autolinking.h>
#else
#define AUTOLINKING_AVAILABLE 0
#endif
#include <fbjni/fbjni.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <rncore.h>
Expand All @@ -61,10 +56,8 @@ void registerComponents(
REACT_NATIVE_APP_COMPONENT_REGISTRATION(registry);
#endif

#if AUTOLINKING_AVAILABLE
// And we fallback to the components autolinked
autolinking_registerProviders(registry);
#endif
}

std::shared_ptr<TurboModule> cxxModuleProvider(
Expand All @@ -78,10 +71,8 @@ std::shared_ptr<TurboModule> cxxModuleProvider(
// return std::make_shared<NativeCxxModuleExample>(jsInvoker);
// }

#if AUTOLINKING_AVAILABLE
// And we fallback to the CXX module providers autolinked
return autolinking_cxxModuleProvider(name, jsInvoker);
#endif

return nullptr;
}
Expand Down Expand Up @@ -112,12 +103,10 @@ std::shared_ptr<TurboModule> javaModuleProvider(
return module;
}

#if AUTOLINKING_AVAILABLE
// And we fallback to the module providers autolinked
if (auto module = autolinking_ModuleProvider(name, params)) {
return module;
}
#endif

return nullptr;
}
Expand Down

0 comments on commit 5443359

Please sign in to comment.