Make hardware-counter.cpp compile

`g++ -std=c++11 -lpthread src/hardware-counter.cpp
src/thread-local.cpp src/test.cpp` works and runs where `src/test.cpp` is:

```

int main() {
  bool enable = true;
  std::string events = "";
  bool recordSubprocesses = false;
  HPHP::HardwareCounter::Init(enable, events, recordSubprocesses);

  HPHP::HardwareCounter::s_counter.getCheck();

  int64_t start = HPHP::HardwareCounter::GetInstructionCount();
  volatile int x;
  for (int i = 0; i < 1000000; i++) {
    x += i;
  }
  int64_t end = HPHP::HardwareCounter::GetInstructionCount();

  printf("%d\n", end - start);
}
```
This commit is contained in:
Ben Alpert
2015-09-18 21:43:47 -07:00
parent 42e523ea4d
commit e922f869e6
5 changed files with 44 additions and 39 deletions

View File

@@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include "hphp/util/thread-local.h"
#include "thread-local.h"
#ifdef __linux__
#include <link.h>