Blender V5.0
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
12
14
16{
17#if defined(OPENSUBDIV_VERSION_NUMBER)
18 return OPENSUBDIV_VERSION_NUMBER;
19#elif defined(OPENSUBDIV_VERSION_MAJOR)
20 return OPENSUBDIV_VERSION_MAJOR * 10000 + OPENSUBDIV_VERSION_MINOR * 100 +
21 OPENSUBDIV_VERSION_PATCH;
22#elif defined(OPENSUBDIV_VERSION)
23 const char *version = STRINGIFY(OPENSUBDIV_VERSION);
24 if (version[0] == 'v') {
25 version += 1;
26 }
27 int major = 0, minor = 0, patch = 0;
28 vector<string> tokens;
29 blender::opensubdiv::stringSplit(&tokens, version, "_", true);
30 if (tokens.size() == 3) {
31 major = atoi(tokens[0].c_str());
32 minor = atoi(tokens[1].c_str());
33 patch = atoi(tokens[2].c_str());
34 }
35 return major * 10000 + minor * 100 + patch;
36#else
37 return 0;
38#endif
39}
#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()