stub out fboss fbcode dependencies

Summary:
Add some stubs to replace fbcode dependencies that were breaking OSS build, plus list some necessary .cpp and libs that were missing in the CMake config

Includes small change to QsfpUtilTx.cpp to fix a -Wsequence-error that cmake flags promoted to error

Reviewed By: shri-khare

Differential Revision: D33708895

fbshipit-source-id: a4f4d557f4155d88d4c59767cd74bec95f63f312
This commit is contained in:
Alex Hornby 2022-01-26 14:31:27 -08:00 committed by Facebook GitHub Bot
parent a6d8f136d8
commit b7bd10a392
2 changed files with 36 additions and 1 deletions

View File

@ -35,7 +35,7 @@ class FacebookBase2 : virtual public cpp2::FacebookServiceSvIf {
time_t startTime;
public:
explicit FacebookBase2(const char*) {
explicit FacebookBase2(std::string name) {
startTime = time(nullptr);
}
@ -75,5 +75,12 @@ class FacebookBase2 : virtual public cpp2::FacebookServiceSvIf {
}
};
/// Stub
class FacebookBase2DeprecationMigration : public FacebookBase2 {
protected:
explicit FacebookBase2DeprecationMigration(std::string name)
: FacebookBase2(std::move(name)) {}
};
} // namespace fb303
} // namespace facebook

28
common/time/Time.h Normal file
View File

@ -0,0 +1,28 @@
/*
* Copyright (c) 2004-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma once
#include <time.h>
namespace facebook {
// Stub. Should probably change calling code to use folly chrono apis instead
class WallClockUtil {
public:
// ---------------- time in seconds ---------------
static time_t NowInSecSlow() {
return ::time(nullptr);
}
static time_t NowInSecFast() {
return ::time(nullptr);
}
};
} // namespace facebook