Blender V4.3
opensubdiv_capi.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2013 Blender Foundation
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "opensubdiv_capi.hh"
6#include "opensubdiv/version.h"
7#ifdef _MSC_VER
8# include <iso646.h>
9#endif
10
11#include "internal/base/util.h"
12
14
16
18{
19#if defined(OPENSUBDIV_VERSION_NUMBER)
20 return OPENSUBDIV_VERSION_NUMBER;
21#elif defined(OPENSUBDIV_VERSION_MAJOR)
22 return OPENSUBDIV_VERSION_MAJOR * 10000 + OPENSUBDIV_VERSION_MINOR * 100 +
23 OPENSUBDIV_VERSION_PATCH;
24#elif defined(OPENSUBDIV_VERSION)
25 const char *version = STRINGIFY(OPENSUBDIV_VERSION);
26 if (version[0] == 'v') {
27 version += 1;
28 }
29 int major = 0, minor = 0, patch = 0;
30 vector<string> tokens;
31 blender::opensubdiv::stringSplit(&tokens, version, "_", true);
32 if (tokens.size() == 3) {
33 major = atoi(tokens[0].c_str());
34 minor = atoi(tokens[1].c_str());
35 patch = atoi(tokens[2].c_str());
36 }
37 return major * 10000 + minor * 100 + patch;
38#else
39 return 0;
40#endif
41}
#define STRINGIFY(x)
void stringSplit(std::vector< std::string > *tokens, const std::string &str, const std::string &separators, bool skip_empty)
int openSubdiv_getVersionHex()
void openSubdiv_cleanup()
void openSubdiv_init()