Make all headers public and add #ifdef __cplusplus (#1150)

Summary:
This change is mostly needed to support the new react-native architecture with Swift. Some private yoga headers end up being included in the swift build and result in compilation failure since swift cannot compile c++ modules. See https://github.com/facebook/react-native/pull/33381.

The most reliable fix is to include all headers as public headers, and add `#ifdef __cplusplus` to those that include c++. This is already what we do for other headers, this applies this to all headers.

Tested in the YogaKitSample, and also in a react-native app.

Changelog:
[iOS] [Changed] - Make all Yoga headers public and add #ifdef __cplusplus

Pull Request resolved: https://github.com/facebook/yoga/pull/1150

Reviewed By: dmitryrykun

Differential Revision: D36966687

Pulled By: cortinico

fbshipit-source-id: a34a54d56df43ab4934715070bab8e790b9abd39
This commit is contained in:
Janic Duplessis
2022-06-07 07:42:49 -07:00
committed by Facebook GitHub Bot
parent 4d089ecc79
commit bfcd15e4a9
10 changed files with 46 additions and 2 deletions

View File

@@ -6,6 +6,9 @@
*/
#pragma once
#ifdef __cplusplus
#include "Yoga-internal.h"
#include "Yoga.h"
@@ -74,3 +77,5 @@ public:
setCloneNodeCallback(YGCloneNodeFunc{nullptr});
}
};
#endif